Subtract one date from another, yielding the number of days between the two dates. : Date Arithmetic « Date Timestamp Functions « Oracle PL/SQL Tutorial






The following example subtracts July 31, 2003, from August 2, 2003:

SQL> SELECT TO_DATE('02-AUG-2003') - TO_DATE('31-JUL-2003') FROM dual;

TO_DATE('02-AUG-2003')-TO_DATE('31-JUL-2003')
---------------------------------------------
                                            2

SQL>








13.26.Date Arithmetic
13.26.1.Using Date Arithmetic
13.26.2.Subtracts two days from August 2, 2003
13.26.3.Subtract one date from another, yielding the number of days between the two dates.
13.26.4.select date '1996-01-29' + interval '1' month as col_1
13.26.5.select date '1997-08-11' - interval '3' month as col_3
13.26.6.Second Tuesday of the Month