当然不行了,那是固定的判断字段是否为空的.
is null

解决方案 »

  1.   

    也可以这样,但效率比 fdname is null 要低
    select * from tbname where isnull(fdname,1)=1
      

  2.   

    where name is null 不是挺好吗?怎么不喜欢这样用吗?我觉得不错嘛
      

  3.   

    null是个特殊的值,特殊的集合,任何和null运算都是null
    where name = null 肯定是null,没有任何集合出来,也不报错对于判断是否为null,只能is null,is not null
      

  4.   

    不能用=null。一定要用is null
      

  5.   

    1. null 是一個值, 這個值是未知的. 也就說,它的數據類型以及值都不確定. 
    2. null這個值區別於 empty , "" , 也區別於 zero , 0 
    3. 據以上兩點, 如下 sql command將不會找到包含有null值的資料行,即便select了null所在的列.
           select name, age, sex from usertable where sex = "男"
           ==> 結果是,查詢出所有sex為男的資料, 並且不包括含有null值的資料行.
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select name, age,&nbsp;sex&nbsp;from usertable where sex&nbsp;<> "男"
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;==> 結果是,查詢出所有sex非男的資料, 並且不包括含有null值的資料行.&nbsp;&nbsp;&nbsp; 
    4.NULL的存在所影響到的查詢結果.
    &nbsp;&nbsp;&nbsp;&nbsp;若需要統計,則明確加入WHERE子句中IS NULL OR IS NOT NULL .
      

  6.   

    不一定
    要看什么字段了,有时候用=null可以查出来