sql 对于时间类型的条件查询时,先入为主地采用等于号判断是否为空,犯了个很低级的错误,防止出错记录一下。

is null 判断为空

select id from post where releaseTime is null

is not null 判断不空

select id from post where releaseTime is not null

我的数据库为 Mysql 8.0。

自我控制是最强者的本能-萧伯纳