当前位置:网站首页>【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
边栏推荐
- 模拟线程通信
- SQL injection - secondary injection and multi statement injection
- 利用OPNET进行网络仿真时网络层协议(以QoS为例)的使用、配置及注意点
- Knapsack problem unrelated to profit (depth first search)
- 设f(x)=∑x^n/n^2,证明f(x)+f(1-x)+lnxln(1-x)=∑1/n^2
- 记录一次压测经验总结
- 《二》标签
- Longest palindrome substring (dynamic programming)
- HarmonyOS第四次培训
- 使用知云阅读器翻译统计遗传学书籍
猜你喜欢

数字化创新驱动指南

Sublime tips

AOSP ~binder communication principle (I) - Overview

SQL injection HTTP header injection

10 distributed databases that take you to the galaxy

《2》 Label

EGR-20USCM接地故障继电器

What changes will PMP certification bring?

Under the trend of Micah, orebo and apple homekit, how does zhiting stand out?

ThinkPHP关联预载入with
随机推荐
Pytest testing framework -- data driven
利用OPNET进行网络任意源组播(ASM)仿真的设计、配置及注意点
c语言神经网络基本代码大全及其含义
数字化创新驱动指南
照片选择器CollectionView
Development thoughts of adding new requirements in secondary development
A cool "ghost" console tool
App embedded H5 --- iPhone soft keyboard blocks input text
人体传感器好不好用?怎么用?Aqara绿米、小米之间到底买哪个
AOSP ~Binder 通信原理 (一) - 概要
Array initialization of local variables
Weebly mobile website editor mobile browsing New Era
线程池的创建与使用
《四》表单
No experts! Growth secrets for junior and intermediate programmers and "quasi programmers" who are still practicing in Universities
Phenomenon analysis when Autowired annotation is used for list
How does redis implement multiple zones?
The execution order of return in JS' try catch finally
局部变量的数组初始化问题
做自媒体,有哪些免费下载视频剪辑素材的网站?