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;

若转载请注明出处!若有疑问,请回复交流!