当前位置:网站首页>【oracle】简单的日期时间的格式化与排序问题
【oracle】简单的日期时间的格式化与排序问题
2022-07-06 23:28:00 【kenwm】
所谓格式化日期指的是将日期转为字符串,或将字符串转为日期,下面几个函数可以用来格式化日期。
TO_CHAR(datetime, 'format')
TO_DATE(character, 'format')
TO_TIMESTAMP(character, 'format')
TO_TIMESTAMP_TZ(character, 'format')
例子
select to_char(a.CREATE_TIME,'yyyy-mm-dd') from students
select * from 表名 where 这里面可以加条件 ORDER BY 日期字段 desc,时间字段 desc
这个是写一个ORDER BY关键字根据日期字段排序然后加个逗号接着写时间字段排序
select to_char(a.CREATE_TIME,'yyyy-mm-dd') from students
where a.s_name like '%黄' order by a.create_time
边栏推荐
- 做自媒体,有哪些免费下载视频剪辑素材的网站?
- If you want to choose some departments to give priority to OKR, how should you choose pilot departments?
- 漏电继电器JD1-100
- Knapsack problem unrelated to profit (depth first search)
- 【PHP SPL笔记】
- Disk monitoring related commands
- 【js组件】date日期显示。
- Auto. JS get all app names of mobile phones
- EGR-20USCM接地故障继电器
- HarmonyOS第四次培训
猜你喜欢
随机推荐
DJ-ZBS2漏电继电器
DBSync新增对MongoDB、ES的支持
[question] Compilation Principle
Array initialization of local variables
精彩速递|腾讯云数据库6月刊
《2》 Label
Development thoughts of adding new requirements in secondary development
项目经理如何凭借NPDP证书逆袭?看这里
Leetcode(46)——全排列
阿里云的神龙架构是怎么工作的 | 科普图解
利用OPNET进行网络任意源组播(ASM)仿真的设计、配置及注意点
线程池的创建与使用
漏电继电器JOLX-GS62零序孔径Φ100
y58.第三章 Kubernetes从入门到精通 -- 持续集成与部署(三一)
EGR-20USCM接地故障继电器
U++ metadata specifier learning notes
[PHP SPL notes]
Complete code of C language neural network and its meaning
What changes will PMP certification bring?
How can professional people find background music materials when doing we media video clips?









