Re: Retrieve 2nd maximum record

From: Joe Bonner <jbonner_at_voyager.net>
Date: Sun, 22 Oct 2000 12:26:05 -0400
Message-ID: <39f39c09$0$30011$2c3edae7_at_news.voyager.net>


There is this handy little pseudo-column you get with a query called rownum. So with a subquery you can
select your records and then with the outer query select the rows of the inner query that you want
 like this select * from
(select ename, rownum as myroworder from scott.emp order by ename desc)  where myroworder = 2;

and you'll select the second ename from scott.emp.

Santanu Ghosh <ghoshbabu_at_usa.net> wrote in message news:8su2o3$roq$1_at_news.vsnl.net.in...
> Hi,
> can anyone write a SINGLE query that will retrive the 2nd(or 3rd or in
 fact
> Nth) maximum record from a set of records.
> Thanks in advance.
>
>
Received on Sun Oct 22 2000 - 18:26:05 CEST

Original text of this message