mysql中时间字段datetime怎么判断为空和不为空

mysql中时间字段datetime怎么判断为空和不为空
一般为空都用null表示,所以一句sql语句就可以。

select * from 表名 where 日期字段 is null;
这里要注意null的用法,不可以用=null这样的形式表示。


相反,要取出不为空的数据,就是is true
select * from 表名 where 日期字段 is true;
原文地址:https://www.cnblogs.com/jpfss/p/11156847.html