因为有的记录有可能日期不用填写的,但又想找它出来,是代码是怎样写呢?
能用“NULL”吗?

解决方案 »

  1.   

    select * from 表
    where 日期列名 is null
      

  2.   

    楼上的条件没错,尽量不要用 select * from 可以查某一列或null
      

  3.   

    若要测试查询中的空值,请在 WHERE 子句中使用 IS NULL 或 IS NOT NULL。
    select * from 表 where 日期列名 is nullselect * from 表 where 日期列名 is not null
      

  4.   

    select * from 表 where 日期列名 is null