-- 当前日期 SELECT TO_CHAR(ADD_MONTHS(SYSDATE, 0), ‘yyyy-MM-dd‘) PRETODAY FROM DUAL -- 上月当前日期 SELECT TO_CHAR(ADD_MONTHS(SYSDATE, -1), ‘yyyy-MM-dd‘) PRETODAY FROM DUAL -- 下月当前日期 SELECT TO_CHAR(ADD_MONTHS(SYSDATE, 1), ‘yyyy-MM-dd‘) PRETODAY FROM DUAL -- 上月首天 SELECT TO_CHAR(ADD_MONTHS(LAST_DAY(SYSDATE) + 1, -2),‘yyyy-MM-dd‘) FIRSTDAY FROM DUAL -- 上月月末 SELECT TO_CHAR(LAST_DAY(ADD_MONTHS(LAST_DAY(SYSDATE) + 1, -2)),‘yyyy-MM-dd‘) FIRSTDAY FROM DUAL -- 当月首天 SELECT TO_CHAR(ADD_MONTHS(LAST_DAY(SYSDATE) + 1, -1), ‘yyyy-MM-dd‘) FIRSTDAY FROM DUAL -- 当月月末 SELECT TO_CHAR(LAST_DAY(ADD_MONTHS(LAST_DAY(SYSDATE) + 1, -1)),‘yyyy-MM-dd‘) FIRSTDAY FROM DUAL -- 下月首天 SELECT TO_CHAR(ADD_MONTHS(LAST_DAY(SYSDATE) + 1, 0), ‘yyyy-MM-dd‘) FIRSTDAY FROM DUAL -- 下月月末 SELECT TO_CHAR(LAST_DAY(ADD_MONTHS(LAST_DAY(SYSDATE) + 1, 0)), ‘yyyy-MM-dd‘) FIRSTDAY FROM DUAL
时间: 2024-10-12 15:22:46