-1

表包含:

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

4

3 回答 3

4
select 'da1', 'dx1', 'dt1', 'db1', 'dc1' from thattable limit 1

应该完美地工作

于 2012-04-17T12:51:40.817 回答
3

交付的详细信息:

select max(c1), max(c2), max(c3), max(c4), max(c5)
from yourtable;

请参阅此处的 MGA 模拟。

于 2012-04-17T12:49:21.177 回答
0

尝试这个。

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
于 2012-04-17T12:50:21.927 回答