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

前端 未结 8 1435
不思量自难忘°
不思量自难忘° 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:41

    If it's a basic query, then just use LIMIT:

    -- get the 4th highest salary
    SELECT salary FROM tbl_salary
    ORDER BY salary DESC
    LIMIT 3,1
    

提交回复
热议问题