按时间间隔查询

select ONH_ID,date_format(CREATE_TIME, '%Y%m%d%H') as date, count(1)
from RIV_OUTBOUND_NOTICE_H
where CREATE_TIME >= '2017-09-22 08:00:00' and CREATE_TIME < '2017-09-22 10:55:23'
GROUP BY date
原文地址:https://www.cnblogs.com/tonggc1668/p/7573438.html