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]