表包含:
c1 c2 c3 c4 c5
da1 Null Null db1 dc1
da1 dx1 Null db1 dc1
da1 Null dy1 db1 Null
都是varchar
领域。
我需要一个查询,其结果数据没有任何空值并且在一行中“ da1 dx1 dy1 db1 dc1
”
select 'da1', 'dx1', 'dt1', 'db1', 'dc1' from thattable limit 1
应该完美地工作
尝试这个。
select * from (select distinct c1, c2, c3, c4, c5 from mytable) as mytab where c1 is not null and c2 is not null and c3 is not null and c4 is not null and c5 is not null