Oracle 中取当前日期的上个月最后天和第一天

前一月 最后一天select last_day(add_months(sysdate,-1)) from dual;               2010-2-28 9:23:01;

                     select to_char(last_day(add_months(sysdate,-1))) from dual;  2010-2-28;

前一月 第天      select add_months(last_day(add_months(sysdate,-1))+1,-1) from dual;                    2010-2-1 9:23:01;

                     select to_char(add_months(last_day(add_months(sysdate,-1))+1,-1)) from dual;       2010-2-1 9:23:01;

posted @ 2010-03-04 09:31  星火卓越  阅读(12089)  评论(0编辑  收藏  举报