From the course: Oracle Database 12c: Basic SQL

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Using ADD_MONTHS

Using ADD_MONTHS

- [Instructor] @_month is a date function in Oracle that allows us add a specified number of months to a specific date. Let's see it in action. Let's select the current sysdate as well as add_months supplying sysdate as the first paramenter and one as the second parameter, but let's not stop here. And type add_months again specifying sysdate, but this time the second parameter will be a value of two, and one more time, add_months, leave sysdate as the first parameter, and this time a value of three as the second parameter from dual. Running this query will return us the current sysdate, the current sysdate plus one month, current sysdate plus two months, and the current sysdate plus three months. So as you can see using add_months you can easily add additional months to a date value. The date value, which is the first argument to the function, can either be dynamically generated, such as when using sysdate, or…

Contents