MONTHS_BETWEEN: number of months between two dates
SQL>
SQL> --If you need the number of months, you need to use this function.
SQL>
SQL> --The syntax for the function is:
SQL>
SQL> --MONTHS_BETWEEN(date1, date2)
SQL>
SQL>
SQL> SELECT MONTHS_BETWEEN('01-JAN-01','01-AUG-01') AS MONTHS_BETWEEN FROM Dual;
MONTHS_BETWEEN
--------------
-7
Related examples in the same category