The examples are simple, intuitive examples of the ADD_MONTHS function. All results are both valid and expected.
Example: Querying the Number of Months in Years to a DATE Expression
This statement returns the current date plus 13 years.
SELECT ADD_MONTHS (CURRENT_DATE, 12*13);
Example: Querying for the Current Date Plus Six Months
This statement returns the date 6 months ago.
SELECT ADD_MONTHS (CURRENT_DATE, -6);
Example: Querying for the Current Date Plus Four Months
This statement returns the current TIMESTAMP plus four months.
SELECT ADD_MONTHS (CURRENT_TIMESTAMP, 4);
Example: Querying for the Current Date Plus Nine Months
This statement returns the TIMESTAMP nine months from January 1, 1999. Note the literal form, which includes the keyword TIMESTAMP.
SELECT ADD_MONTHS (TIMESTAMP '1999-01-01 23:59:59', 9);
Example: Querying for the Current Date Plus One Month
This statement adds one month to January 30, 1999.
SELECT ADD_MONTHS ('1999-01-30', 1);
The result is 1999-02-28.