posts - 119, comments - 62, trackbacks - 0, articles - 0

Mysql 时间字段处理

Posted on 2011-11-07 11:56 Kevin Meng 阅读(250) 评论(0)  编辑  收藏
字段为Datetime,获得2011-11-05以后添加的记录
SELECT *  FROM geo_corporation t WHERE TO_DAYS(t.addtime)>TO_DAYS('2011-11-05')
某一时间段内的记录
SELECT *  FROM geo_corporation t WHERE TO_DAYS(t.addtime)>TO_DAYS('2011-11-05') AND TO_DAYS(t.addtime)<TO_DAYS('2011-11-7')

只有注册用户登录后才能发表评论。


网站导航: