select datediff (curdate(), hire_date ) as diff from emp order by hire_date asc;
But, this does not give the output in months, how to get it in months?
try something like: SELECT DATEDIFF(month, curdate(), hire_date) AS diff
SELECT DATEDIFF(month, curdate(), hire_date) AS diff
1.4m articles
1.4m replys
5 comments
57.0k users