海詩網(wǎng) 知識(shí)百科 interval函數(shù)(sql interval函數(shù))

interval函數(shù)(sql interval函數(shù))

interval函數(shù), 區(qū)間函數(shù)有兩種:簡單用法和高級(jí)用法。以下是具體的使用方法和例子。

sql interval函數(shù)

1.簡單用法

Format: Interval time year/month/day/hour/minute/second

示例:

Select the system date-the interval is 10 years ago,

Sysdate-10 months ago,

System date-10 days ago,

Sysdate-the interval of 10 hours is 10 hours ago,

System date-10 minutes ago,

Sysdate-the interval of 10 seconds is 10 seconds ago,

The system date-10 is 10 days ago.

sysdate - 10/24 as 10小時(shí)前,

Sysdate-10/(24 * 60) means 10 minutes ago,

Sysdate-10/(24 * 3600) as 10 seconds ago

from dual;

2.高級(jí)用法

Format: interval [|-][y][-m][ year [(year _ precision)]] [to month]

參數(shù)說明:[]或[-]是可選指標(biāo),表示時(shí)間間隔是正還是負(fù)(默認(rèn)為正)。

y是可選參數(shù),表示時(shí)間間隔的年數(shù)部分。

m是可選參數(shù),表示時(shí)間間隔的月份部分。如果指定年數(shù)和月數(shù),則必須在INTERVAL子句中包含TO MONTH。

Year_precision是描述年的精度的可選參數(shù)(默認(rèn)為2)。

sql interval函數(shù)

關(guān)于區(qū)間函數(shù)的用法,就分享到這里吧!

interval函數(shù),以上就是本文為您收集整理的interval函數(shù)最新內(nèi)容,希望能幫到您!更多相關(guān)內(nèi)容歡迎關(guān)注。

本文來自網(wǎng)絡(luò),不代表海詩網(wǎng)立場,轉(zhuǎn)載請(qǐng)注明出處:http://x91880.com/n/169668.html
      

python(python什么東西)

發(fā)表回復(fù)
聯(lián)系我們
聯(lián)系我們

在線咨詢: QQ交談

郵箱: 3587015498@qq.com

工作時(shí)間:周一至周五,9:00-17:30,節(jié)假日休息

關(guān)注微信
微信掃一掃關(guān)注我們
微信掃一掃關(guān)注我們
關(guān)注微博
返回頂部