展开全部
select * from Biz_ExamCollection where collectionType = 5 AND date_format(createDTM,'%Y-%m-%d') <= date_format(DATE_SUB(curdate(), INTERVAL 1 MONTH),'%Y-%m-%d')
MySQL查询指e69da5e6ba903231313335323631343130323136353331333433626463定时间的数据:
#获取当月数据
SELECT * FROM user_event WHERE DATE_FORMAT(create_time,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')
#获取3月份数据
SELECT * FROM user_event WHERE DATE_FORMAT(create_time,'%Y-%m') = DATE_FORMAT('2016-03-01','%Y-%m')
#获取三月份数据
SELECT * FROM user_event WHERE YEAR(create_time)='2016' AND MONTH(create_time)='3'
#获取本周数据
SELECT * FROM user_event WHERE YEARWEEK(DATE_FORMAT(create_time,'%Y-%m-%d')) = YEARWEEK(NOW());
#查询上周的数据
SELECT * FROM user_event WHERE YEARWEEK(DATE_FORMAT(create_time,'%Y-%m-%d'