mysql 查询某个日期时间段,每天同一时间段的数据:
SELECT * FROM t_a01_eltable WHERE DATE_FORMAT(acqtime,'%Y-%m-%d')>='2016-01-01' AND DATE_FORMAT(acqtime,'%Y-%m-%d')<='2016-05-20' AND DATE_FORMAT(acqtime,'%H')>=18 AND DATE_FORMAT(acqtime,'%H')<=19;
mysql 查询某个日期时间段,每天同一时间段的数据:
SELECT * FROM t_a01_eltable WHERE DATE_FORMAT(acqtime,'%Y-%m-%d')>='2016-01-01' AND DATE_FORMAT(acqtime,'%Y-%m-%d')<='2016-05-20' AND DATE_FORMAT(acqtime,'%H')>=18 AND DATE_FORMAT(acqtime,'%H')<=19;