Purpose
The NUMTOYMINTERVAL function converts the value of the n parameter to an INTERVAL YEAR TO MONTH value with the specified unit.
Syntax
NUMTOYMINTERVAL (n,interval_unit)
Parameters
Parameter |
Description |
|---|---|
| n | A NUMBER data type or an expression that can be converted to a NUMBER data type. |
| interval_unit | The unit. Valid values: YEAR and MONTH. The value is not case-sensitive. |
Return type
INTERVAL YEAR TO MONTH
Examples
Return the date and time value 3 years after the current date.
obclient> SELECT SYSDATE,SYSDATE+NUMTOYMINTERVAL(3,'YEAR') AS RES FROM DUAL;
+-----------+-----------+
| SYSDATE | RES |
+-----------+-----------+
| 18-NOV-21 | 18-NOV-24 |
+-----------+-----------+
1 row in set
