muyeqing

欢迎来到muyeqing>>   | 首页 资源中心 | rman | 数据仓库 | install and upgrade | Oracle | 一般分类 | ITPUB论坛

INTERVAL literals

发表人:muyeqing | 发表时间: 2005年七月29日, 16:19

An interval specifies a period of time.

interval_year_to_month
INTERVAL 'integer [- integer]' { YEAR | MONTH } [( precision )] [TO { YEAR | MONTH }]

Examples:
INTERVAL '123-2' YEAR(3) TO MONTH
An interval of 123 years, 2 months. You must specify the leading field precision if it is greater than the default of 2 digits.

INTERVAL '123' YEAR(3)
An interval of 123 years 0 months.

INTERVAL '300' MONTH(3)
An interval of 300 months.

INTERVAL '4' YEAR
Maps to INTERVAL '4-0' YEAR TO MONTH and indicates 4 years.

INTERVAL '50' MONTH
Maps to INTERVAL '4-2' YEAR TO MONTH and indicates 50 months or 4 years 2 months.

INTERVAL '123' YEAR
Returns an error, because the default precision is 2, and '123' has 3 digits.

interval_day_to_second
INTERVAL ' { integer | integer time_expr | time_expr } '
{ { DAY | HOUR | MINUTE } [( leading_precision )])
| SECOND [( leading_precision [, fractional_seconds_precision] )]
}
[TO { DAY | HOUR | MINUTE | SECOND [( fractional_seconds_precision )] }]


Examples:
INTERVAL '4 5:12:10.222' DAY TO SECOND(3)
4 days, 5 hours, 12 minutes, 10 seconds, and 222 thousandths of a second.

INTERVAL '4 5:12' DAY TO MINUTE
4 days, 5 hours and 12 minutes.

INTERVAL '400 5' DAY(3) TO HOUR
400 days 5 hours.

INTERVAL '400' DAY(3)
400 days.

INTERVAL '11:12:10.2222222' HOUR TO SECOND(7)
11 hours, 12 minutes, and 10.2222222 seconds.

INTERVAL '11:20' HOUR TO MINUTE
11 hours and 20 minutes.

INTERVAL '10' HOUR
10 hours.

INTERVAL '10:22' MINUTE TO SECOND
10 minutes 22 seconds.

INTERVAL '10' MINUTE
10 minutes.

INTERVAL '4' DAY
4 days.

INTERVAL '25' HOUR
25 hours.

INTERVAL '40' MINUTE
40 minutes.

INTERVAL '120' HOUR(3)
120 hours

INTERVAL '30.12345' SECOND(2,4)
30.1235 seconds. The fractional second '12345' is rounded to '1235' because the precision is 4.


[回复]

HELP. Who than can on treatment 6 years children. It is necessary 75 000 $ dollars for complex operation. We ask you. Though as that help. Forward means for electronic purse WEBMONEY: WMID - 244643338994, Purse - Z379794871935. Parents of the boy.

fankom | 24/03/2007, 13:13

发表评论

标题

在此添加评论

称呼

邮箱地址(可选)

个人主页(可选)




Valid XHTML 1.0 Strict and CSS. Powered by pLog
Design by Blog.lvwo.com