Re: Retrieve 2nd maximum record

From: Stas K. <kostos_at_dsgcertified.nl>
Date: Tue, 24 Oct 2000 16:31:27 +0400
Message-ID: <8t3vel$5u0$1_at_dragon.infopro.spb.su>


1st:

   select max(fld_x) from tab_y
2nd:

   select max(fld_x) from tab_y where fld_x<(select max(fld_x) from tab_y) 3rd:

   select max(fld_x) from tab_y where fld_x<(select max(fld_x) from tab_y where fld_x<(select max(fld_x) from tab_y)) e.t.c.

PS
  I do not know latest versions, but in Oracle 8.0.5 you can not use 'order by' in subquery ;-(

"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 Tue Oct 24 2000 - 14:31:27 CEST

Original text of this message