Skip to content
Advertisement

How to find third or nᵗʰ maximum salary from salary table?

How to find third or nth maximum salary from salary table(EmpID, EmpName, EmpSalary) in optimized way?

Advertisement

Answer

Use ROW_NUMBER(if you want a single) or DENSE_RANK(for all related rows):

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement