OracleDate/Time FunctionsMONTHS_BETWEEN
ADD_MONTHS

MONTHS_BETWEENDate/Time Functions

LAST_DAY

Returns the number of months between two dates.

Syntax

MONTHS_BETWEEN(d1, d2)

Example

Enter values below to update the example in real time.

employee_id
hire_date
months_served
employees
-- 근속 개월 수
SELECT employee_id,
       FLOOR(MONTHS_BETWEEN(SYSDATE, hire_date)) AS months_served
FROM employees;