Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
WITH RECURSIVE date_table AS ( -- Base case: Start with the initial date SELECT '2005-07-01'::DATE AS date UNION ALL -- Recursive case: Add one day to the previous date SELECT date + INTERVAL '1 day' FROM date_table WHERE date < '2005-07-31' -- Stop when the date reaches the end date ) SELECT date FROM date_table;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear