Date Range Produce Series
Generate a contiguous date range using a recursive CTE for filling missing calendar gaps in time series analysis.
Code
WITH RECURSIVE date_range(d) AS (
SELECT DATE '2026-01-01'
UNION ALL
SELECT d + INTERVAL 1 DAY
FROM date_range
WHERE d < DATE '2026-12-31'
)
SELECT d FROM date_range;Report a problem with this exampleOpens a pre-filled issue on GitHub.