TO_YMINTERVAL
Example
Section titled “Example”SELECT TO_YMINTERVAL('02-05') FROM DUAL;Output
Section titled “Output”+-------------------+| TO_YMINTERVAL('02-05') |+-------------------+| +02-05 |+-------------------+Explanation
Section titled “Explanation”The TO_YMINTERVAL function converts a string of YYYY-MM format into an INTERVAL YEAR TO MONTH literal. In the given query, ‘02-05’ is transformed to an interval of 2 years and 5 months. It returns the equivalent INTERVAL YEAR TO MONTH value.