首页 > 学院 > 开发设计 > 正文

Oracle查询日期

2019-11-08 20:47:24
字体:
来源:转载
供稿:网友

–基础语句 select add_months(last_day(sysdate)+1,0) from dual; select last_day(sysdate) from dual;

–组合效果 – 当前日期 select add_months(sysdate,0) 当前日期 from dual; – 上月当前日期 select add_months(sysdate,-1) 上月当前日期 from dual; – 下月当前日期 select add_months(sysdate,1) 下月当前日期 from dual; – 上月首天 select add_months(last_day(sysdate)+1,-2) 上月首天 from dual; – 上月月末 select last_day(add_months(sysdate,-1)) 上月月末 from dual; – 当月首天 select add_months(last_day(sysdate)+1,-1) 当月首天 from dual; – 当月月末 select last_day(sysdate) 当月月末 from dual; – 下月首天 select add_months(last_day(sysdate)+1,0) 下月首天 from dual; – 下月月末 select add_months(last_day(sysdate),1) 下月月末 from dual;


上一篇:实用SQL语句

下一篇:SQL Server触发器详解

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表