How to find third or nth maximum salary from salary table(EmpID, EmpName, EmpSalary) in optimized way?
table(EmpID, EmpName, EmpSalary)
Just change the inner query value: E.g Select Top (2)* from Student_Info order by ClassID desc
Use for both problem:
Select Top (1)* from ( Select Top (1)* from Student_Info order by ClassID desc ) as wsdwe order by ClassID