当前位置:网站首页>Oracle TRUNC function processing date format
Oracle TRUNC function processing date format
2022-06-27 17:20:00 【Senda Technology】
GPS platform 、 Website construction 、 software development 、 The system operational , Find Senda network technology !
https://cnsendnet.taobao.com
From the official blog of Sunda Technology
http://www.cnsendblog.com/index.php/?p=2204
Another explanation , After interception, the result is still date data type
select to_char(sysdate,‘yyyy-mm-dd hh24:mi:ss’) from dual; -- Display current time
2011-12-29 16:24:34
select trunc(sysdate,‘year’) from dual; -- Cut to year ( The first day of the year )
2011-1-1
select trunc(sysdate,‘q’) from dual; -- Intercept to quarter ( The first day of the quarter )
2011-10-1
select trunc(sysdate,‘month’) from dual; -- Intercept to month ( The first day of the month )
2011-12-1
select trunc(sysdate,’’) from dual;
empty
select to_char(trunc(sysdate),‘yyyymmdd hh24:mi:ss’) from dual; -- The default interception date is ( Zero minute and zero second of the day )
20111229 00:00:00
trunc(sysdate) This is the intercept date section , When you need to use dates for grouping , You can use this function , As shown below edit by sand
select trunc(sysdate-1,‘w’) from dual; – The Thursday closest to the current time , If the current day is Thursday, return to the current day , Otherwise, return to last Thursday
2011-12-22
select trunc(sysdate,‘ww’) from dual; -- Intercepted last weekend ( Last Saturday )
2011-12-24
select trunc(sysdate,‘day’) from dual; -- Intercept to week ( First day of the week , Last Sunday )
2011-12-25
select trunc(sysdate,‘iw’) from dual; -- This week 2 God , This Monday
2011-12-26
select to_char(trunc(sysdate,‘dd’),‘yyyymmdd hh24:mi:ss’) from dual;– Intercept to day ( Zero minute and zero second of the day )
20111229 00:00:00
select trunc(sysdate,‘hh24’) from dual; -- Intercept to hours ( Current hour , Zero minute zero second )
2011-12-29 16:00:00
select trunc(sysdate,‘mi’) from dual; -- Intercept points ( The current points , Zero seconds )
2011-12-29 16:24:00
select trunc(sysdate,‘ss’) from dual ;– Report errors , There is no format accurate to seconds
GPS platform 、 Website construction 、 software development 、 The system operational , Find Senda network technology !
https://cnsendnet.taobao.com
From the official blog of Sunda Technology
http://www.cnsendblog.com/index.php/?p=2204
边栏推荐
- ROS "topic" programming implementation
- d3dx9_ How to repair 32.dll? d3dx9_ Solution to 32.dll missing
- 软件测试学习-黑马程序员,软件测试学习大纲
- Introduction to photoswape
- Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
- P4251 [scoi2015] small convex play matrix (still a little confused)
- 深耕数字化,引领云原生,服务更多开发者
- Pragma once Usage Summary
- Adaoracle supports multi chain distributed Oracle with wide area node quotation
- Why should string be designed to be immutable?
猜你喜欢

数据中心表格报表实现定制统计加班请假汇总记录分享

全面解析零知识证明:消解扩容难题 重新定义「隐私安全」

Leetcode 5. Longest Palindromic Substring

如何提升IT电子设备效能管理

Oracle概念二

Smart wind power | Tupu software digital twin wind turbine equipment, 3D visual intelligent operation and maintenance

Sliding window + monotone queue concept and example (p1886 Logu)

leetcode 142. Circular linked list II

当发布/订阅模式遇上.NET
![[fxcg] today's market analysis](/img/97/fc6faa5ab693e383f085b407ce1d85.jpg)
[fxcg] today's market analysis
随机推荐
Byte + Google super full kotlin learning King fried notes! Kotlin introductory tutorial + Advanced kotlin enhanced actual combat (with demo)
Leetcode 704. Binary search
模拟进程调度
C language teacher workload management system
d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download
医院预约挂号系统-系统结构
QT5 之信号与槽机制(信号与槽的基本介绍)
Oracle concept II
P4251 [scoi2015] small convex play matrix (still a little confused)
事务的隔离级别详解
When the publish / subscribe mode encounters NET
10 minutes to master the installation steps of MySQL
当发布/订阅模式遇上.NET
leetcode 92. Reverse linked list II
IDE Eval reset unlimited trial reset
SQLite net (SQLite is used by unity, WPF and WinForm)
深耕数字化,引领云原生,服务更多开发者
简历如何去写?
C语言集合运算
Leetcode 33. Search rotation sort array