当前位置:网站首页>【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
边栏推荐
- Dbsync adds support for mongodb and ES
- 【js组件】自定义select
- Longest common subsequence (LCS) (dynamic programming, recursive)
- U++ game learning notes
- 阿里云的神龙架构是怎么工作的 | 科普图解
- 与利润无关的背包问题(深度优先搜索)
- Salesforce 容器化 ISV 场景下的软件供应链安全落地实践
- App embedded H5 --- iPhone soft keyboard blocks input text
- Is the human body sensor easy to use? How to use it? Which do you buy between aqara green rice and Xiaomi
- Dbsync adds support for mongodb and ES
猜你喜欢
U++ metadata specifier learning notes
Is PMP really useful?
Leetcode(46)——全排列
最长回文子串(动态规划)
pmp真的有用吗?
Window scheduled tasks
No experts! Growth secrets for junior and intermediate programmers and "quasi programmers" who are still practicing in Universities
Annotation初体验
利用OPNET进行网络指定源组播(SSM)仿真的设计、配置及注意点
HarmonyOS第四次培训
随机推荐
磁盘监控相关命令
Knapsack problem (01 knapsack, complete knapsack, dynamic programming)
【opencv】图像形态学操作-opencv标记不同连通域的位置
Under the trend of Micah, orebo and apple homekit, how does zhiting stand out?
Addressable pre Download
阿里云的神龙架构是怎么工作的 | 科普图解
vector和类拷贝构造函数
QSlider of QT control style series (I)
Auto.js 获取手机所有app名字
《四》表单
Let f (x) = Σ x^n/n^2, prove that f (x) + F (1-x) + lnxln (1-x) = Σ 1/n^2
QT控件样式系列(一)之QSlider
《2》 Label
Tencent cloud database public cloud market ranks top 2!
Annotation初体验
U++ game learning notes
If you‘re running pod install manually, make sure flutter pub get is executed first.
《五》表格
2039: [Bluebridge cup 2022 preliminaries] Li Bai's enhanced version (dynamic planning)
DFS,BFS以及图的遍历搜索