博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
oracle日期函数、字符串函数、格式化方式
阅读量:4350 次
发布时间:2019-06-07

本文共 939 字,大约阅读时间需要 3 分钟。

select last_day(sysdate) from dual;--某个时间对应月份的最后一天select next_day(sysdate,'星期二') from dual;--某个时间对应星期的下一周期select add_months(sysdate,2) from dual;--某个时间对应月份的下几个月份select ename,trunc(months_between(sysdate,hiredate)) from emp;--员工入职至现在共计多少个月select to_char(sysdate,'yyyy-mm-dd') time from dual;--某个时间以XX格式显示select to_char(sysdate,'yyyy') year ,to_char(sysdate,'mm') month,to_char(sysdate,'dd')from dual;--查询某个时间所对应年、月、日、时。分、秒select to_char(sysdate,'yyyy-mm-dd hh:mi:ss') time from dual;--某个时间以XX格式显示(12小时:时分秒)select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') time from dual;--某个时间以XX格式显示(24小时:时分秒)select to_char(890783453485,'999,999,999,999,999,999') from dual;--以某格式显示传入参数select to_char(890783453485,'L999,999,999,999,999,999') from dual;--(L代表当前语言环境下的货币符号)select to_date('1989-06-24','yyyy-mm-dd') from dual;--格式化时间alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';--更改当前会话的日期显示方式

 

转载于:https://www.cnblogs.com/brightkite/p/9680541.html

你可能感兴趣的文章
HTML—链接
查看>>
将进程设置为守护进程
查看>>
用连接池提高Servlet访问数据库的效率
查看>>
luogu P1494 [国家集训队]小Z的袜子 ( 普 通 )
查看>>
树的数据结构
查看>>
MyEclipse导入Color Theme
查看>>
Vue开发微信H5 微信分享签名失败问题解决方案
查看>>
Linux - 配置SSH免密通信 - “ssh-keygen”的基本用法
查看>>
Python(2.7.6) glob - 匹配指定模式的文件
查看>>
HTTP - 持久连接
查看>>
添加路由时啥时候是dev啥时候是gw
查看>>
redis 中文字符显示
查看>>
登录日志分析常用查询
查看>>
Codeforces Round #228 (Div. 1) 388B Fox and Minimal path
查看>>
【nosql实现企业网站系列之一】mongodb的安装
查看>>
短信服务供应商价格总览
查看>>
获取本机IP(考虑多块网卡、虚拟机等复杂情况)
查看>>
笔记之_java整理ORM框架
查看>>
CentOS下安装python3.x版本
查看>>
CAP定理(原则)以及BASE理论
查看>>