queries [message #374416] |
Mon, 11 June 2001 05:43 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Raj
Messages: 411 Registered: November 1998
|
Senior Member |
|
|
query
for second maximum salary in employee table
or nth maximum salary in employee table
|
|
|
Re: queries [message #374480 is a reply to message #374416] |
Thu, 14 June 2001 04:59 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Thirumalai and Prakash
Messages: 23 Registered: March 2001
|
Junior Member |
|
|
Hi Raj,
The query to find nth maximum is
select min(f) from (select distinct f from tbl order by f desc ) where rownum < &n + 1
Where, f is field and tbl is table name.
Regards
S.Thirumalai
|
|
|
Re: queries [message #374481 is a reply to message #374416] |
Thu, 14 June 2001 05:02 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
Thirumalai and Prakash
Messages: 23 Registered: March 2001
|
Junior Member |
|
|
Hi Raj,
The query to find nth maximum is
select min(f) from (select distinct f from tbl order by f desc ) where rownum < &n + 1
Where, f is field and tbl is table name.
Regards
S.Thirumalai
|
|
|