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 @ 2016-05-09 09:51  zfswff  阅读(3459)  评论(0编辑  收藏  举报