oracle中月初月末的表示
程序员文章站
2022-05-15 09:15:57
...
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
上一篇: CentOS下搭建SVN服务器
下一篇: vue快速入门(二)
推荐阅读
-
Oracle数据库中SP和表之间的关系
-
oracle数据库中rman备份归档日志的常用脚本
-
oracle中的trim函数使用介绍
-
VMware中linux环境下oracle安装图文教程(二)ORACLE 10.2.05版本的升级补丁安装
-
linux下oracle报错,提示ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务的解决办法
-
Oracle Form中COMMIT的概述及使用技巧
-
oracle中left join和right join的区别浅谈
-
Oracle中在pl/sql developer修改表的2种方法
-
Oracle性能优化——SQL基线(SQLbaseline)的载入与进化(11g中引入的基线)
-
Oracle 11gR2中启动Scott用户的方法(推荐)