MAKE_YM_INTERVAL
Description
The MAKE_YM_INTERVAL
function is used to create a time interval measured in years and months. This function can accept two parameters, which are the number of years and the number of months, both of which are optional. The created interval type is interval year to month
.
Parameters
years
: Integer type, representing the number of years.months
: Integer type, representing the number of months.
Return Type
Returns a value of type interval year to month
.
Example
- Create a time interval of 1 year:
- Create a time period of 2 years and 3 months:
- Create a time period that only includes 6 months:
Notes
- When there is only one parameter, the system defaults the year to 1.
- When
NULL
is used as a parameter, it means that the parameter is not involved in the calculation of the time interval.