Oracle9i SQL Reference Release 1 (9.0.1) Part Number A90125-01 |
|
Functions, 5 of 166
add_months::=
add_months
ADD_MONTHS
returns the date d plus n months. The argument n can be any integer. If d is the last day of the month or if the resulting month has fewer days than the day component of d, then the result is the last day of the resulting month. Otherwise, the result has the same day component as d.
The following example returns the month after the hire_date in the sample table employees
:
SELECT TO_CHAR( ADD_MONTHS(hire_date,1), 'DD-MON-YYYY') "Next month" FROM employees WHERE last_name = 'Baer'; Next Month ----------- 07-JUL-1994
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|