Solved programming problem

Show each employees employee_id, email and his total current experience in 10 years, 6 months and 15 days format

Source code

SELECT EMPLOYEE_ID,

CONCAT(DATEDIFF(CURDATE(),HIRE_DATE) DIV 365 ," years, ",(DATEDIFF(CURDATE(),HIRE_DATE) MOD 365) DIV 30," months and ",DATEDIFF(CURDATE(),HIRE_DATE) MOD 30)

FROM employees;
Join the discussion

Add your comment