MYSQL 按时间 GROUP BY

SELECT DATE_FORMAT( startDateTime, "%Y-%m-%d %H" ) AS date, COUNT(*) AS num
FROM data_service
GROUP BY date ORDER BY date;

按照每天每小时统计数量

 

End.

posted @ 2014-06-25 15:45  lianche  阅读(2274)  评论(0编辑  收藏  举报