怎样取得本月的第一天和本月最后一天?--急急
怎样取得本月的第一天和本月最后一天?
------解决方案--------------------SELECT LAST_DAY(SYSDATE) FROM DUAL;
------解决方案--------------------看错了,sorry.
> select sysdate, trunc(sysdate, 'MM ') as first_d,
2 trunc(add_months(sysdate,1), 'MM ')-1 as last_d
3 from dual;
SYSDATE FIRST_D LAST_D
------------------- ------------------- -------------------
2007-06-21 09:57:32 2007-06-01 00:00:00 2007-06-30 00:00:00