日期常用取值
2015-09-14 16:10
537 查看
select date,
to_number(to_char(date,'hh24')) 时,
to_number(to_char(date,'mi')) 分,
to_number(to_char(date,'ss')) 秒,
to_number(to_char(date,'dd')) 日,
to_number(to_char(date,'mm')) 月,
to_number(to_char(date,'yyyy')) 年,
to_number(to_char(date,'ddd')) 年内第几天,
trunc(date,'dd') 一天之始,
trunc(date,'day') 周初,
trunc(date,'mm') 月初,
last_day(date) 月末,
add_months(trunc(date,'mm'),1) 下月初,
trunc(date,'yy') 年初,
to_char(date,'day') 周几,
to_char(date,'month') 月份
from (select date+30/24/60/60+20/24/60+5/25 as date from tab where rownum<=1);
to_number(to_char(date,'hh24')) 时,
to_number(to_char(date,'mi')) 分,
to_number(to_char(date,'ss')) 秒,
to_number(to_char(date,'dd')) 日,
to_number(to_char(date,'mm')) 月,
to_number(to_char(date,'yyyy')) 年,
to_number(to_char(date,'ddd')) 年内第几天,
trunc(date,'dd') 一天之始,
trunc(date,'day') 周初,
trunc(date,'mm') 月初,
last_day(date) 月末,
add_months(trunc(date,'mm'),1) 下月初,
trunc(date,'yy') 年初,
to_char(date,'day') 周几,
to_char(date,'month') 月份
from (select date+30/24/60/60+20/24/60+5/25 as date from tab where rownum<=1);
相关文章推荐
- 基于 Red Hat 的发行版 Oracle Linux 正式发布Oracle Linux 7.1
- Oracle Containers for J2EE远程安全漏洞(CVE-2014-0413)
- Oracle 10g R2不能使用EM的问题
- 表空间操作
- PreparedStatement中in子句的处理
- VMware下RedHat4.8_64位安装Oracle 10g RAC--简略脚本
- oracle sql日期比较
- 基于 Red Hat 的发行版 Oracle Linux 正式发布Oracle Linux 7.1
- OS block size和Oracle block size,查找OS Blocksize的方法
- oracle中创建数据库和表空间的几点总结
- 数据库自动备份脚本
- DB2 日期和时间的函数应用说明
- oracle的nvl函数的使用介绍
- 解决oracle用户连接失败的解决方法
- oracle的一些tips技巧
- Oracle 下的开发日积月累
- Oracle存储过程之数据库中获取数据实例
- Windows下ORACLE 10g完全卸载的方法分析