当前位置:网站首页>【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
边栏推荐
猜你喜欢

数字化如何影响工作流程自动化

Is the human body sensor easy to use? How to use it? Which do you buy between aqara green rice and Xiaomi

SQL injection HTTP header injection

Torch optimizer small parsing

漏电继电器LLJ-100FS

SQL injection cookie injection

Leetcode(46)——全排列

全链路压测:影子库与影子表之争

Phenomenon analysis when Autowired annotation is used for list

《五》表格
随机推荐
Where is NPDP product manager certification sacred?
【PHP SPL笔记】
DJ-ZBS2漏电继电器
最全常用高数公式
数字化如何影响工作流程自动化
与利润无关的背包问题(深度优先搜索)
Auto.js 获取手机所有app名字
How does redis implement multiple zones?
EGR-20USCM接地故障继电器
Linkedblockingqueue source code analysis - initialization
Creation and use of thread pool
y58.第三章 Kubernetes从入门到精通 -- 持续集成与部署(三一)
漏电继电器JD1-100
最长不下降子序列(LIS)(动态规划)
最长回文子串(动态规划)
How can project managers counter attack with NPDP certificates? Look here
Development thoughts of adding new requirements in secondary development
【最佳网页宽度及其实现】「建议收藏」
[PHP SPL notes]
项目经理如何凭借NPDP证书逆袭?看这里