Requirement
Generate a list of days to compare against
Solution
SELECT *
FROM (SELECT TRUNC(SYSDATE - ROWNUM) DT
FROM DUAL
CONNECT BY ROWNUM < 31
UNION
SELECT TRUNC(SYSDATE + ROWNUM) DT
FROM DUAL
CONNECT BY ROWNUM < 31)DATERANGE;
Acknowledgement
https://stackoverflow.com/questions/9166877/how-to-generate-list-of-all-dates-between-sysdate-30-and-sysdate30
Comments
Post a Comment