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;
转载于:https://www.cnblogs.com/hanyun/archive/2013/03/08/2949457.html