SQL 查询某字段id为空(不为空)

1 sql 查询某字段id为空

  

    select *  from  表名 where  id  is   null  ;

 

2 sql 查询某字段id不为空

 

    select * from   表名  where id  is  not  null;

 

或 select * from   表名  where id  <> null;     //

    select * from   表名  where   len(id) >1;    // (最后两个PL/SQL下验证不正确!)

 

 由于null 为一种状态,不是一个值,故建议不适用算术逻辑符号“<>” !

posted @ 2015-03-27 10:43  facial  阅读(3708)  评论(0编辑  收藏  举报