MySQL - 日期比较的Where子句

时间:2012-11-30 00:50:17

标签: mysql sql

我有这个查询

select count(*) from sl_list 
where type = 'pantry'

返回数千行,如下所示:

    uuid     type      create_dtime               mod_dtime
 124234525   pantry     2012-06-13 15:25:58       2012-06-13 15:27:51

我想调整查询,以便有另一个where子句声明:

select count(*) from sl_list 
where type = 'pantry'
and "if create_dtime and mod_dtime are not the same day (i dont care about hours)"

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

select count(*) from sl_list 
where type = 'pantry'
and date(create_dtime) <> date(mod_dtime)