Oracle SQL - Write SQL to add and subtract month from a date

Requirements

Write SQL to add and subtract month from a date

For a given date, add one month time.

For another given date, subtract three month time.

Demo

SQL>
SQL> select date '1996-01-29' + interval '1' month as col_1
  2    ,    date '1997-01-28' + interval '1' month as col_2
  3    ,    date '1997-08-11' - interval '3' month as col_3
  4  from   dual;

COL_1     COL_2     COL_3--  w w w  . java2  s. c o  m
--------- --------- ---------
29-FEB-96 28-FEB-97 11-MAY-97

SQL>

Related Quiz