I am trying to generate a list of years, starting with 2010 and counting up through 5 years from the current date. For example, if it is currently 2013, the list would include 2010 through 2018. 2 years from now, I want the list to go from 2010 through 2020.
I am currently using
SELECT to_char(add_months(to_date('2010','YYYY'),12 * (rownum-1)),'YYYY')
FROM dual
CONNECT BY level <= 10
to get a list with 10 entries. How can I make this dynamic enough to return a variable number of records depending on the current year?
Thanks in advance,
Tom
Edited by: PRISM on Feb 15, 2013 12:05 PM: Please disregard this message - I found what I needed in this thread:
1101400