How to find n'th highest value of a column?

前端 未结 8 1615
不思量自难忘°
不思量自难忘° 2021-02-20 07:56

Is there a command akin to:

  • 2nd highest salary from tbl_salary or

  • 4th highest salary from tbl_salary ?

8条回答
  •  渐次进展
    2021-02-20 08:36

    select * from employee order by salary desc limit 1,1
    

    Description : limit x,y

    • x: The row offset from which you want to start displaying records. For nth record it will be n-1.
    • y: The number of records you want to display. (Always 1 in this case)

提交回复
热议问题