The TO_YMInterval function in Oracle SQL / PLSQL is used to convert a string value to Interval Year to Month type.
Syntax for the TO_YMInterval function in Oracle SQL / PLSQL is:
SELECT TO_YMInterval(character_1)
FROM table_name;
character_1 can be CHAR, VARCHAR2, NCHAR OR NVARCHAR2 data type, it is the value that will be converted to Interval Year to Month.
Examples:
SELECT TO_YMINTERVAL('5-11') FROM dual;
Would return 5 years and 11 months as Year to Month Interval type