Oracle中Trunc和Round--Date Format Models

ROUND and TRUNC Date Functions

Table 7-13 lists the format models you can use with the ROUND and TRUNC date functions and the units to which they round and truncate dates. The default model, 'DD', returns the date rounded or truncated to the day with a time of midnight.

Table 7-13 Date Format Models for the ROUND and TRUNC Date Functions

Format ModelRounding or Truncating Unit
CC
SCC
One greater than the first two digits of a four-digit year
SYYYY
YYYY
YEAR
SYEAR
YYY
YY
Y
Year (rounds up on July 1)
IYYY
IY
IY
I
ISO Year
Q
Quarter (rounds up on the sixteenth day of the second month of the quarter)
MONTH
MON
MM
RM
Month (rounds up on the sixteenth day)
WW
Same day of the week as the first day of the year
IW
Same day of the week as the first day of the ISO year
W
Same day of the week as the first day of the month
DDD
DD
J
Day
DAY
DY
D
Starting day of the week
HH
HH12
HH24
Hour
MI
Minute

The starting day of the week used by the format models DAY, DY, and D is specified implicitly by the initialization parameter NLS_TERRITORY.

转载于:https://www.cnblogs.com/joeblackzqq/archive/2011/02/16/1955928.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值