SELECT DATE_FORMAT( startDateTime, "%Y-%m-%d %H" ) AS date, COUNT(*) AS numFROM data_serviceGROUP BY date ORDER BY date;
按照每天每小时统计数量
End.
MYSQL 按时间 GROUP BY
时间: 2024-10-05 05:18:21
SELECT DATE_FORMAT( startDateTime, "%Y-%m-%d %H" ) AS date, COUNT(*) AS numFROM data_serviceGROUP BY date ORDER BY date;
按照每天每小时统计数量
End.
MYSQL 按时间 GROUP BY