Let's review ADD_MONTHS!



ADD_MONTHS

Syntax: ADD_MONTHS ( start date, number of months )

Parameters: Start date is the date before adding number of months to it. number of months are the months to be added in start date.

Return type: The ADD_MONTHS function returns date value.

Usage: According to company's policy, HR Manager evaluates the progress of each employee exactly after 6 months from the joining date. Manager wants all the dates on which evaluation of each employee has been done. Manager to data analyst: Bring me the list of all employees with their first evaluation date.

Data analyst runs below query to fetch the required data.

SELECT EMPLOYEE_ID, FIRST_NAME, LAST_NAME, ADD_MONTHS(HIRE_DATE, 6) AS
EVALUATION_DATE FROM EMPLOYEES;




Comments

Popular posts from this blog

Let's learn Left Outer Join!

Let's extract STRING!

Let's learn Cross Join!