--Show employeename with manager name
select a.id,a.name,b.name as 'mgrname',a.salary from
emp a left join emp b on(b.id=a.mgrid)
--Nth max salary
select * from emp e1 where (N-1)=(select count(distinct e2.salary) from emp e2
where e2.salary>e1.salary)
No comments:
Post a Comment