我一个表user
zhh   yhmc  cbbbh(字符型)  ncbbbh(数值型)
001   张三  
002   李四     01            1
003   王五     01            1我要查cbbbh为空的
select * from user where trim(cbbbh)=''   //始终报错
select * from user where ncbbbh=0   //始终报错我怎么才能把这个 表本号为空的查出来呢

解决方案 »

  1.   

    select * from user where cbbbh is null
      

  2.   

    查询空记录要用:
    select * from user where cbbbh is null
      

  3.   

    select * from user where (cbbbh=nil)
      

  4.   

    select * from user where cbbbh is null or ncbbbh is null
      

  5.   


    select * from user where (cbbbh is null)or(cbbbh='')
      

  6.   

    选 星 从 用户 当 cbbbh 是 空
      

  7.   

    select * from user where trim(cbbbh)='' 
    当cbbbh为空的时候,trim(cbbbh)返回的也是空,而在sql中空值是不能进行直接比较或赋值操作的
    select * from user where cbbbh is null
    //查非空
    select * from user where cbbbh is not null