Nth max salary in Oracle

前端 未结 26 1675
名媛妹妹
名媛妹妹 2020-11-30 07:02

To find out the Nth max sal in oracle i\'m using below query

SELECT DISTINCE sal 
FROM emp a 
WHERE (
       SELECT COUNT(DISTINCE sal) 
       FROM emp b 
          


        
26条回答
  •  旧巷少年郎
    2020-11-30 07:46

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

提交回复
热议问题