SQL query to finf employees details for second maximum salary

Select * from emp where sal= (select max(sal) from emp where sal<(select max(sal) form emp))

The above query returns all the details of the employee whose salary is second highest.

(select max(sal) from emp where sal<(select max(sal) form emp)) will return the second max salary of an employee.

More : [1]

0 comments:

Post a Comment

Who ever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs u can at least use Name/URL option which don’t even require any sign-in, good thing is that it can accept your lovely nick name also and URL is not mandatory too.
Thanks for your patience
~Best job portal admin(I love "Transparency")