to select all the employees who have joined most recently under king

So if you just need a list of employees that were hired after King was hired, just use King’s hire date as the filter.

select e.*,datediff(dd,e.hiredate,getdate()) min_exp 
from emp e 
where e.hiredate > (SELECT hiredate FROM emp WHERE ename="king") 

Test the statement and make adjustments where needed. I didn’t verify it.

Leave a Comment