Detect Missing Months
Hard
Time Series SQL
Return every month (as 'YYYY-MM') between the first and the last month that has sales in which there were no sales at all. Order by month.
Table schema
Sales(sale_date DATE, amount INT)Sample data
sale_date | amount
2026-01-10 | 100
2026-02-05 | 50
2026-04-20 | 70
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.