select ADD_MONTHS(TRUNC(SYSDATE,'MONTH'),-1) + dt
from (select level dt from dual connect by level < 32)
Where ADD_MONTHS(TRUNC(SYSDATE,'MONTH'),-1) + dt < TRUNC(SYSDATE,'MONTH')
----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
PS: The above is to generate a list of all the days of last month.
Typo fix:
Code:
select ADD_MONTHS(TRUNC(SYSDATE,'MM'),-1) + dt - 1
from (select level dt from dual connect by level < 32)
Where ADD_MONTHS(TRUNC(SYSDATE,'MM'),-1) + dt - 1 < TRUNC(SYSDATE,'MM')
/
----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.