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

后端 未结 30 732
醉酒成梦
醉酒成梦 2020-11-30 16:30

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

30条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 17:18

    Refer following query for getting nth highest salary. By this way you get nth highest salary in MYSQL. If you want get nth lowest salary only you need to replace DESC by ASC in the query. nth highest salary

提交回复
热议问题