当前位置:网站首页>【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
边栏推荐
- Harmonyos fourth training
- QT simple layout box model with spring
- JVM(二十) -- 性能监控与调优(一) -- 概述
- 第一篇论文的写作流程
- Addressable 预下载
- Is the human body sensor easy to use? How to use it? Which do you buy between aqara green rice and Xiaomi
- 带你遨游银河系的 10 种分布式数据库
- 《5》 Table
- If you want to choose some departments to give priority to OKR, how should you choose pilot departments?
- How can project managers counter attack with NPDP certificates? Look here
猜你喜欢
随机推荐
做自媒体视频剪辑,专业的人会怎么寻找背景音乐素材?
《2》 Label
ScheduledExecutorService定时器
Leetcode(417)——太平洋大西洋水流问题
带你遨游银河系的 10 种分布式数据库
[opencv] image morphological operation opencv marks the positions of different connected domains
漏电继电器JOLX-GS62零序孔径Φ100
设f(x)=∑x^n/n^2,证明f(x)+f(1-x)+lnxln(1-x)=∑1/n^2
【QT】自定义控件-Loading
EGR-20USCM接地故障继电器
pytest测试框架——数据驱动
How can professional people find background music materials when doing we media video clips?
Safe landing practice of software supply chain under salesforce containerized ISV scenario
最长不下降子序列(LIS)(动态规划)
【PHP SPL笔记】
AOSP ~Binder 通信原理 (一) - 概要
qt 简单布局 盒子模型 加弹簧
SQL injection HTTP header injection
Clickhouse (03) how to install and deploy Clickhouse
Pytest testing framework -- data driven