मैंने आपकी क्वेरी को निम्नानुसार अपडेट किया है:
SELECT
order_date,
SUM(rn = 1) AS quantity
FROM
(SELECT
order_date,
row_number() over(PARTITION BY YEAR(order_date - INTERVAL 2 MONTH), customerID ORDER BY order_date) rn
FROM customers
) t
GROUP BY 1;