TO_YMINTERVAL function in Oracle

TO_YMINTERVAL is one of the vital Conversion functions of Oracle. It is used to convert a string to an INTERVAL YEAR TO MONTH value. The TO_YMINTERVAL function is supported in the various versions of the Oracle/PLSQL, including, Oracle 12c, Oracle 11g, Oracle 10g and Oracle 9i.

Syntax:

TO_YMINTERVAL ( char )

Parameters:
char: It is used to specify the string to be converted.

Example:

TO_YMINTERVAL( '09-12’ )

Output:

9 years 12 months

Explanation:
Here, a string is converted to an INTERVAL YEAR TO MONTH value.