Saturday, June 13, 2015

Oracle find 7th highest salary of an employee from a table

Here you can find 7th highest sal

SELECT *
FROM emp a
WHERE (7) = (
SELECT COUNT( DISTINCT ( E.Sal ) )
FROM emp E
WHERE e.Sal >= a.Sal
)

No comments:

Post a Comment