|
Re: How do i get n'th greatest salary from EMP table [message #21392 is a reply to message #21391] |
Wed, 31 July 2002 23:19 |
Chandan Singh
Messages: 14 Registered: July 2002
|
Junior Member |
|
|
Check this Query to get nth greatest salary.
select min(sal) "2nd Highest Sal" from
(select sal from
(select distinct sal from emp order by sal desc)
where rownum <= '&1');
after executing this query u will be prompted to enter the number like after entering 2 it will show u the 2 highest salary.
Emp table is the same table that ships with the oracle.
I hope this will solve your problem.
|
|
|
|