21,891
社区成员
发帖
与我相关
我的任务
分享
mysql> select concat(year('2009-9-26'),'-',
-> month('2009-9-26'),'-01',' 00:00:00') begin,
-> concat(last_day('2009-9-26'),' 23:59:59') end;
+--------------------+---------------------+
| begin | end |
+--------------------+---------------------+
| 2009-9-01 00:00:00 | 2009-09-30 23:59:59 |
+--------------------+---------------------+
1 row in set (0.00 sec)
select * from t where left(tdate,10) between '2009-9-1' and '2009-10-1'