当前位置:网站首页>Oracle/PLSQL: NumToDSInterval Function

Oracle/PLSQL: NumToDSInterval Function

2022-06-27 01:35:00 yuanlnet

In Oracle/PLSQL, the numtodsinterval function converts a number to an INTERVAL DAY TO SECOND literal.

Syntax

The syntax for the numtodsinterval function is:

numtodsinterval( number, expression )

number is the number to convert to an interval.

expression is the unit. It must be one of the following values: DAY, HOUR, MINUTE, or SECOND.

Applies To

  • Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

For Example

numtodsinterval(150, 'DAY')

would return '+000000150 00:00:00.000000000'

numtodsinterval(1500, 'HOUR')

would return '+000000062 12:00:00.000000000'

numtodsinterval(15000, 'MINUTE')

would return +000000010 10:00:00.000000000'

numtodsinterval(150000, 'SECOND')

would return '+000000001 17:40:00.000000000'

原网站

版权声明
本文为[yuanlnet]所创,转载请带上原文链接,感谢
https://blog.csdn.net/yuanlnet/article/details/125446755