关于Oracle数据库timestamp数据类型

2018-01-29 12:41:05来源:网络收集作者:纳米程序员人点击

分享

关于Oracle数据库timestamp数据类型:


https://docs.oracle.com/database/121/SQLRF/sql_elements001.htm#SQLRF0021




TIMESTAMP[(fractional_seconds_precision)]


Year, month, and day values of date, as well as hour, minute, and second values of time, where fractional_seconds_precision is
the number of digits in the fractional part of the SECOND datetime
field. Accepted values of fractional_seconds_precision are
0 to 9. The default is 6. The default format is determined explicitly by theNLS_TIMESTAMP_FORMAT parameter
or implicitly by the NLS_TERRITORY parameter. The size is 7 or
11 bytes, depending on the precision. This data type contains the datetime fields YEAR, MONTH, DAY, HOUR,MINUTE,
and SECOND. It contains fractional seconds but does not have a
time zone.


fractional_seconds_precision是秒的小数部分的精度位数,这个精度位数从0到9,默认是6


大家知道,比秒更小的单位有毫秒(ms),微秒(us),纳秒(ns)


1秒=1000毫秒(ms)


1毫秒=1000微秒(us)


1微秒=1000纳秒(ns)


我推测timestamp数据类型秒的小数部分的精度位数最精确到9,就是为了表示并存储纳秒。


最新文章

123

最新摄影

闪念基因

微信扫一扫

第七城市微信公众平台