V_DATE  DATE; 
SELECT TRUNC(SYSDATE,'MM') INTO V_DATE FROM DUAL;
SELECT LAST_DAY(SYSDATE) INTO V_DATE FROM DUAL;

SELECT TRUNC(ADD_MONTHS(SYSDATE,-1),'MM') INTO V_DATE FROM DUAL;
SELECT LAST_DAY(ADD_MONTHS(SYSDATE,-1)) INTO V_DATE FROM DUAL;

SELECT TRUNC(ADD_MONTHS(SYSDATE,-11),'MM') INTO V_DATE FROM DUAL;
SELECT LAST_DAY(ADD_MONTHS(SYSDATE,-11)) INTO V_DATE FROM DUAL;

SELECT TRUNC(ADD_MONTHS(SYSDATE,-12),'MM') INTO V_DATE FROM DUAL;
SELECT LAST_DAY(ADD_MONTHS(SYSDATE,-12)) INTO V_DATE FROM DUAL;
posted on 2013-03-08 10:48  寒云  阅读(5949)  评论(0编辑  收藏  举报