1 查询时间段:
则直接字段 大于 或小于该时间段 即可
select * from t_person where born >= '2000-01-01' and born <= '2017-01-01'
或者用 BETWEEN AND (前开后闭)
2 查询某天、某周、某月、某年 的数据
select * from t_person where DATEDIFF(day, "2017-01-01", '2017-01-01') ;
select * from t_person where DATEDIFF(week, "2017-01-01", '2017-01-01') ;
select * from t_person where DATEDIFF(month, "2017-01-01", '2017-01-01') ;
select * from t_person where DATEDIFF(year, "2017-01-01", '2017-01-01') ;