oracle中月初月末的表示
当前日期
select to_char(add_months(sysdate,0),'yyyy-MM-dd') day from dual
上月当前日期
select to_char(add_months(sysdate,-1),'yyyy-MM-dd') day from dual
下月当前日期
select to_char(add_months(sysdate,1),'yyyy-MM-dd') day from dual
上月首天
select to_char(add_months(last_day(sysdate)+1,-2),'yyyy-MM-dd') day from dual
上月月末
select to_char(last_day(add_months(last_day(sysdate)+1,-2)),'yyyy-MM-dd') day from dual
当月首天
select to_char(add_months(last_day(sysdate)+1,-1),'yyyy-MM-dd') day from dual
当月月末
select to_char(last_day(add_months(last_day(sysdate)+1,-1)),'yyyy-MM-dd') day from dual
下月首天
select to_char(add_months(last_day(sysdate)+1,0),'yyyy-MM-dd') day from dual
下月月末
select to_char(last_day(add_months(last_day(sysdate)+1,0)),'yyyy-MM-dd') day from dual