例子:

SELECT HOUR(column_name) AS hour, COUNT(*) AS count
FROM table_name
GROUP BY HOUR(column_name)