If you looking for preformance use this:
SELECT SAL, TOP_SAL
FROM
(SELECT SAL, ROW_NUMBER() OVER(ORDER BY SAL DESC NULLS LAST) TOP_SAL
FROM KEY_KEYWORD)
WHERE TOP_SAL <= 5; -- TOP 5 SAL.
|
Results 1 to 6 of 6
Thread: To select n th highestThreaded View
|
Click Here to Expand Forum to Full Width |