MySQLDate/Time FunctionsQUARTER
WEEK

QUARTERDate/Time Functions

COUNT

Returns the quarter of the year.

Syntax

QUARTER(date)

Example

Enter values below to update the example in real time.

order_date
total_amount
revenue
orders
-- 분기별 매출 집계
SELECT QUARTER(order_date) AS q, SUM(total_amount) AS revenue
FROM orders
WHERE YEAR(order_date) = 2024
GROUP BY q;