how to retrieve the top-nth employee in the employees table regarding salary
top-n queries
Collapse
X
-
Tags: None
-
try to use rownum after sorting as per salary.
you need to post the query that you have tried for fouther assistance from our experts. -
for example
Code:SELECT * FROM ( SELECT DEPTNO, ENAME, SAL, ROW_NUMBER() OVER(PARTITION BY DEPTNO ORDER BY SAL DESC) TOPN FROM SALES ) WHERE TOPN<=1
Comment
Comment