SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table T (date_begin date, date_end date); INSERT INTO T VALUES(TO_DATE('01/01/2020', 'DD/MM/YYYY'), TO_DATE('03/01/2020', 'DD/MM/YYYY')); INSERT INTO T VALUES(TO_DATE('03/01/2020', 'DD/MM/YYYY'), TO_DATE('05/01/2020', 'DD/MM/YYYY')); INSERT INTO T VALUES(TO_DATE('05/01/2020', 'DD/MM/YYYY'), TO_DATE('07/01/2020', 'DD/MM/YYYY')); WITH cte(D) AS ( SELECT MIN(date_begin) D FROM T UNION ALL SELECT (cte.D + INTERVAL '1' DAY ) D FROM cte WHERE D < (SELECT MAX(date_end) FROM T) ) SELECT * FROM cte;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear