Orders per Month of 2026, Zeros Included
MediumDescription
Generate the 12 months of 2026 with a recursive CTE. For each month show month
(its first day, as a DATE) and orders: the number of orders placed in that month, 0 when
there were none.
End your query with ORDER BY month.
Tables
| orders |
|---|
| order_id (PK) |
| order_date |