SELECT HOUR(timestamp) AS Hour,
MINUTE(timestamp) AS minute,
COUNT(*)
FROM Messages
GROUP BY HOUR(timestamp), MINUTE(timestamp)
ORDER BY HOUR(timestamp) DESC, MINUTE(timestamp) DESC
SELECT TIMESTAMP(DATE(timestamp),MAKETIME(HOUR(timestamp),MINUTE(timestamp),0))
,COUNT(1)
FROM
Messages
GROUP BY TIMESTAMP(DATE(timestamp),MAKETIME(HOUR(timestamp),MINUTE(timestamp),0))
ORDER BY TIMESTAMP(DATE(timestamp),MAKETIME(HOUR(timestamp),MINUTE(timestamp),0))
2条答案
按热度按时间xj3cbfub1#
尝试:
cczfrluj2#