MySQLDate/Time FunctionsHOUR
DAY

HOURDate/Time Functions

MINUTE

Returns the hour.

Syntax

HOUR(time)

Example

Enter values below to update the example in real time.

created_at
order_count
orders
-- 시간대별 주문량
SELECT HOUR(created_at) AS hour, COUNT(*) AS order_count
FROM orders
GROUP BY hour
ORDER BY hour;