SELECT HOUR(e.time) as Hour,count(*) as Count
FROM error_log e
WHERE e.date = '2017-09-02'
GROUP BY HOUR(e.time) ORDER BY Hour(e.time);
The following is a screenshot of the query results
In another article, I summarize the statistics once every half-hour method of inquiry. Mysql query of the day every half-hour record number
Original Address: https: //blog.csdn.net/qq_28766327/article/details/77856896