This query is to get second highest salary from a table
select top1 salary from(select top2 salary from employee order by salary desc)
employee order by salary asc