Mysql query the number of the day, every hour of data

 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
Write pictures described here

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

Guess you like

Origin www.cnblogs.com/jpfss/p/11129527.html