1
2
3
4
5 SELECT
6 customer_id,
7 YEAR (order_date),
8 COUNT (order_id) order_count
9FROM
10 sales.orders
11GROUP BY
12 customer_id,
13 YEAR (order_date)
14HAVING
15 COUNT (order_id) >= 2
16ORDER BY
17 customer_id;
18Code language: SQL (Structured Query Language) (sql)