Oracle中查询某字段不为空或者为空的SQL语句怎么写?

如题所述

比如\x0d\x0ainsert into table a (a1,b1)values("a1",'');\x0d\x0a对于这种情况,因为表里存的是'',其实是没有内容的,要查询这个字段,不能直接使用\x0d\x0aselect *\x0d\x0afrom a\x0d\x0awhere b1='';\x0d\x0asql中判断非空不能用等号,因为null在sql中被看作特殊符号,必须使用关键字 is和not\x0d\x0a应该如此使用:\x0d\x0aselect * from A where b1 is null\x0d\x0a或者:\x0d\x0aselect * from A where b1 is not null
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜