作者:拍友2502904975 | 来源:互联网 | 2014-06-09 00:50
MySql查询特定时间段数据select*fromwap_contentwhereweek(created_at)week(now)如果你要严格要求是某一年的,那可以这样www.2cto.com查询一天:select*fromtablewhereto_days(col...Syn
MySql查询特定时间段数据
select * from wap_content where week(created_at) = week(now)
如果你要严格要求是某一年的,那可以这样
www.2cto.com
查询一天:
select * from table where to_days(column_time) = to_days(now());
select * from table where date(column_time) = curdate();
查询一周: www.2cto.com
select * from table where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(column_time);
查询一个月:
select * from table where DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= date(column_time);