SELECT TRUNC (ADD_MONTHS ('01-JAN-19', LEVEL - 1), 'MM') start_date,
LAST_DAY (ADD_MONTHS ('01-JAN-19', LEVEL - 1)) end_date
FROM DUAL
CONNECT BY LEVEL <= CEIL (MONTHS_BETWEEN ('30-JUN-19', '01-JAN-19'))
LAST_DAY (ADD_MONTHS ('01-JAN-19', LEVEL - 1)) end_date
FROM DUAL
CONNECT BY LEVEL <= CEIL (MONTHS_BETWEEN ('30-JUN-19', '01-JAN-19'))
0 comments: