您的位置:首页 > 博客中心 > 数据库 >

Oracle 11g SQL fundamentals 03 -- 日期操作函数

时间:2022-03-14 02:20

1、Oracle日期在内部的表示是数值格式,精确度从世纪到秒。

2、默认的日期表示格式为DD-MON-RR  (不是YY)

YY 与 RR 的区别:

gxlsystem.com,布布扣

3、日期操作函数

gxlsystem.com,布布扣

示例:

gxlsystem.com,布布扣

NEXT_DAY的第二个参数也可以是数字,表示几天后的日期。LAST_DAY是求该日期所在月份的最后一天。gxlsystem.com,布布扣

ROUND(‘DD-11-2014‘,‘MONTH‘)是精确到月,‘日’1-15号算这个月的 (‘01-11-2014‘),超过15号算下个月的 (‘01-12-2014‘)。

ROUND(‘DD-MON-2014‘,‘YEAR‘)是精确到年,‘月’1-6月算今年的 (‘DD-MON-2014‘),6-12月算下一年的 (‘DD-MON-2015‘),如图。

 

gxlsystem.com,布布扣 gxlsystem.com,布布扣 gxlsystem.com,布布扣

热门排行

今日推荐

热门手游