sql 语句,查询筛选掉几列 “同时为null” 的数据

如图: 我想要一条ORACLE的sql语句 筛选掉 第5 6条数据,也就是 date/exp_new/exp_old/imp_new/imp_old 同时 为null的数据(此时name是不为null的),注意我说的是“同时”啊。

谢谢各位大神~
我要的是 “去掉”同时 为null的剩下的数据,也就是 不包含那几个字段同时为null的

第1个回答  2014-08-12
select * from table where date is null and exp_new is null and exp_old is null and imp_new is null and name is not null ;
下面这个:
select * from table where date is not null and exp_new is not null and exp_old is not null and imp_new is not null and name is not null ;追问

你这个语句 会把 2 3 4条语句都筛掉的,最后只剩下1

追答

select * from table

minus

select * from table where date is null and exp_new is null and exp_old is null and imp_new is null and name is not null

望采纳。

本回答被提问者采纳
相似回答