a表,时间字段为create_time
查询过去一年的数据
select * from a
where create_time between date_add(date(curdate()), interval -1 year) and date(curdate());
过去一个月
select * from a
where create_time between date_add(date(curdate()), interval -1 month) and date(curdate());