有一表 
id    name
1     a
2     null
3     b
怎么查出表里面name字段为null的所有记录啊

解决方案 »

  1.   

    select * from table where name is null
      

  2.   

    恩,要用is null 不能用=
      

  3.   

    select id,name from table where name is null
      

  4.   

    select * from 表名 where [name] is null
      

  5.   

    也可以这样查询:
    select * 
    from table 
    where name =‘’
      

  6.   

    除这个外都可以
    select * 
    from table 
    where name =‘’这个是查询为空的记录
    空记录!=null
    结贴吧
      

  7.   

    where isnull(name,':)') = ':)'
      

  8.   

    牵强一点说有两种数据为空的情况,一种就是在MMC中内容显示为<null>
    另一种就是什么都不显示的
    所以 ~——~
    where name is null or name=''
      

  9.   

    select * from table where name is null