List all the months using oracle sql .
- by Suresh S
Guys is there any better way to list all the months other than this
select to_char(add_months(to_date('01/01/1000', 'DD/MM/RRRR'), ind.l-1),
'MONTH') as
month_descr
, ind.l as month_ind
from dual descr
, (
select l
from (select level l from dual connect by level <=
12)
) ind
order by 2;
ANSWER :
SELECT to_char(add_months(SYSDATE, (LEVEL-1 )),'MONTH') as months FROM dual CONNECT BY LEVEL <= 12