select * from 表名 where hour(时间字段)>=8 and hour(时间字段)
mysql 中,统计一个时间段内每天8时到12时的数据的查询语句怎么写
select * from 表名 where hour(时间字段)>=8 and hour(时间字段)<=122017-07-13
where time>8点的时间戳 and time< 12时间戳2017-07-13
SELECT * FROM
(
SELECT *,DATE_FORMAT(create_time,'%H') time from tableA
) t
where t.time>122019-05-23