TO_YMINTERVAL
TO_YMINTERVAL is an Oracle SQL function that converges a character string representing an interval of years or months and returns an INTERVAL YEAR TO MONTH type.
Example
Output
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.