I was just searching for a QUERY which gives me the Nth Max sal of an employee. And found this:
Code: Select all
select max(sal)
from emp
where level = 10
connect by prior sal > sal
start with sal = (select max(sal) from emp)
Code: Select all
select max(sal)
from emp
where level = 10
connect by prior sal > sal
start with sal = (select max(sal) from emp)
Code: Select all
SELECT *
FROM EMPLOYEE E1
WHERE 10 =
(SELECT COUNT(DISTINCT E2.SALARY) FROM
EMPLOYEE E2 WHERE E2.SALARY>=E1.SALARY)
You need to be a member in order to post a reply
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute