Friday, September 11, 2009

DATE OF ONE MONTH

SELECT TRUNC (TO_DATE (:p11, 'DDMMYYYY'), 'MM') - 1 + ROWNUM date_month
FROM all_objects
WHERE ROWNUM <=
ADD_MONTHS (TRUNC (TO_DATE (:p11, 'DDMMYYYY'), 'MM'), 1)
- TRUNC (TO_DATE (:p11, 'DDMMYYYY'), 'MM')


SELECT TRUNC (TO_DATE (:p11, 'DDMMYYYY'), 'MM') - 1 + ROWNUM date_month
FROM all_objects
WHERE ROWNUM <=
ADD_MONTHS (TRUNC (TO_DATE (:p11, 'DDMMYYYY'), 'MM'), 1)
- TRUNC (TO_DATE (:p11, 'DDMMYYYY'), 'MM')

No comments: