Oracle PL/SQL Tutorial/Date Timestamp Functions/NUMTODSINTERVAL

Материал из SQL эксперт
Версия от 10:04, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

NUMTODSINTERVAL()

NUMTODSINTERVAL(x, interval_unit) converts the number x to an INTERVAL DAY TO SECOND with the interval for x supplied in interval_unit.

You may set interval_unit to DAY , HOUR , MINUTE , or SECOND.

13. 13. NUMTODSINTERVAL 13. 13. 1. NUMTODSINTERVAL() 13. 13. 2. <A href="/Tutorial/Oracle/0260__Date-Timestamp-Functions/NUMTODSINTERVAL15DAY.htm">NUMTODSINTERVAL(1.5, "DAY")</a> 13. 13. 3. <A href="/Tutorial/Oracle/0260__Date-Timestamp-Functions/NUMTODSINTERVAL325HOUR.htm">NUMTODSINTERVAL(3.25, "HOUR")</a> 13. 13. 4. <A href="/Tutorial/Oracle/0260__Date-Timestamp-Functions/NUMTODSINTERVAL5MINUTE.htm">NUMTODSINTERVAL(5, "MINUTE")</a> 13. 13. 5. <A href="/Tutorial/Oracle/0260__Date-Timestamp-Functions/NUMTODSINTERVAL10123456789SECOND.htm">NUMTODSINTERVAL(10.123456789, "SECOND")</a>

NUMTODSINTERVAL(10.123456789, "SECOND")

SQL> SELECT
  2    NUMTODSINTERVAL(10.123456789, "SECOND")
  3  FROM dual;
NUMTODSINTERVAL(10.123456789,"SECOND")
---------------------------------------------------------------------------
+000000000 00:00:10.123456789
SQL>


NUMTODSINTERVAL(1.5, "DAY")

SQL> SELECT
  2    NUMTODSINTERVAL(1.5, "DAY")
  3  FROM dual;
NUMTODSINTERVAL(1.5,"DAY")
---------------------------------------------------------------------------
+000000001 12:00:00.000000000
SQL>


NUMTODSINTERVAL(3.25, "HOUR")

SQL> SELECT
  2    NUMTODSINTERVAL(3.25, "HOUR")
  3  FROM dual;
NUMTODSINTERVAL(3.25,"HOUR")
---------------------------------------------------------------------------
+000000000 03:15:00.000000000
SQL>


NUMTODSINTERVAL(5, "MINUTE")

SQL> SELECT
  2    NUMTODSINTERVAL(5, "MINUTE")
  3  FROM dual;
NUMTODSINTERVAL(5,"MINUTE")
---------------------------------------------------------------------------
+000000000 00:05:00.000000000
SQL>