Definition:
The Oracle PL/SQL NUMTOYMINTERVAL function converts an input number to its specified Interval Year to Month Unit equivalent. The allowed interval units can be YEAR or MONTH. The return type of the function is INTERVAL.
Example Syntax
NUMTOYMINTERVAL(n, interval unit)
Note that the Interval unit specification is case insensitive.
Example Usage
The SQL queries below converts 1 to possible Year to Month Interval units.
SQL> SELECT NUMTOYMINTERVAL(1,'YEAR') FROM DUAL;
NUMTOYMINTERVAL(1,'YEAR')
---------------------------------
+000000001-00
SQL> SELECT NUMTOYMINTERVAL(1,'MONTH') FROM DUAL;
NUMTOYMINTERVAL(1,'MONTH')
----------------------------------
+000000000-01
Related Links:
Related Code Snippets: