I want to retrieve all the quarters in the past 10 years using the query -
SELECT TO_CHAR(sysdate, 'yyyy" Q "')||level AS QuarterDate
FROM dual
CONNECT BY level <= 4
Using above query I will get quarter for current year. I want for past 10 years.
Similary, is there a way to get all months in past 10 years in the format-
SELECT DISTINCT to_char(sysdate, 'yyyy / mm') from dual
Similarly, is there a way to get past all 10 years.