SELECT ADDDATE(y.first, x.d - 1) as dFROM(SELECT 1 AS d UNION ALLSELECT 2 UNION ALLSELECT 3 UNION ALLSELECT 4 UNION ALLSELECT 5 UNION ALLSELECT 6 UNION ALLSELECT 7 UNION ALLSELECT 8 UNION ALLSELECT 9 UNION ALLSELECT 10 UNION ALLSELECT 11 UNION ALLSEL
转自:http://www.cnblogs.com/likwo/archive/2010/04/16/1713282.html 查询一天: select * from table where to_days(column_time) = to_days(now());select * from table where date(column_time) = curdate(); 查询一周: select * from table where DATE_SUB(CURDATE(), INTER
(转载)http://www.cnblogs.com/likwo/archive/2010/04/16/1713282.html 查询一天: select * from table where to_days(column_time) = to_days(now());select * from table where date(column_time) = curdate(); 查询一周: select * from table where DATE_SUB(CURDATE(), INTE