mysql 按日期查询

在mysql中,比如你的表的时间字段是column2,并且column2的类型是timestamp

单日查询:

select * from TableName where column1='xxxx' and date(column2)='2015-05-29'

 

日期范围查询:

select * from TableName where column1='xxxx' and date(column2) between '2015-02-03' and '2015-06-03'

posted @ 2015-06-03 16:48  奥雷连诺  阅读(205)  评论(0编辑  收藏  举报