The range of leading_precision values is 0 to 9, and the default is 2. The time_expr format is: HH[:MI[:SS[.N]] or MI[:SS[.N]] or SS[.N, and N represents a microsecond.
There are many similarities between this type and interval year to month, and it is recommended that you look at interval to month first.
Range Value:
Hour:0 to 23
Minute:0 to 59
second:0 to 59.999999999
eg
INTERVAL ' 4 5:12:10.222 ' Day to SECOND (3)
said: 4 days 5 hours 12 minutes 10.222 seconds
INTERVAL ' 4 5:12 ' to MINUTE
said: 4 days 5 hours 12 minutes
INTERVAL ' 5 ' Day (3) to HOUR
Indicates: 400 days 5 hours, 400 is 3 precision, so "day (3)", note that the default value is 2.
INTERVAL ' Day (3)
said: 400 days
INTERVAL ' 11:12:10.2222222 ' HOUR to SECOND (7)
said: 11 hours 12 minutes 10.2222222 seconds
INTERVAL ' 10:22 ' MINUTE to SECOND
said: 10 minutes 22 seconds
INTERVAL ' MINUTE '
said: 10 points
INTERVAL ' 4 ' Day
said: 4 days
INTERVAL ' HOUR '
said: 25 Hours
INTERVAL ' MINUTE '
said: 40 points
INTERVAL ' HOUR ' (3)
said: 120 hours
INTERVAL ' 30.12345 ' SECOND (2,4)
Represents: 30.1235 seconds, because the precision of the local seconds is set to 4, to be rounded.
INTERVAL ' day-interval ' HOUR = INTERVAL ' 10-0 ' Day to SECOND
said: 20 days-240 hours = 10 days 0 seconds
==================
Part of the Source: http://www.oraclefans.cn/forum/showblog.jsp?rootid=140
The INTERVAL day to second type stores the time difference between two timestamp, expressed as a date, hour, minute, and second. The internal code for this data type is 183, the length bit 11 bytes:
L 4 bytes represents days (increase 0x80000000 offset)
L hours, minutes, and seconds are expressed in one byte (increase by 60 offset)
L 4 bytes representing the hour difference of the second (increase 0x80000000 offset)
Here is an example:
Sql> ALTER TABLE TestTimestamp add F interval day to second;
The table has changed.
sql> Update TestTimestamp Set f= (select Interval ' 5 ' Day + Interval ' "second from dual);
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.