Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: about finding the nth value using a QUERY - urgent

Re: about finding the nth value using a QUERY - urgent

From: schong <schong_at_werple.mira.net.au>
Date: Fri, 26 Mar 1999 04:15:40 -0800
Message-ID: <36FB7A6C.7901@werple.mira.net.au>


Try this instead :-

> > select *
> > from
> > (
> > select rownum rank, a.*
> > from
> > (
> > select sno, marks
> > from rankings
> > group by marks
> > ) a
> > )

Jurij Modic wrote:
>
> On Thu, 25 Mar 1999 03:49:42 -0800, schong <schong_at_werple.mira.net.au>
> wrote:
>
> >Try this :-
> >
> > select *
> > from
> > (
> > select rownum rank, a.*
> > from
> > (
> > select sno, marks
> > from rankings
> > order by marks desc
> > ) a
> > )
> > where rank = <the nth maximum value>;
> >
> > Now do you homework!!
>
> Would you care to specify the release of Oracle RDBMS you are using
> with the above statement? If it is anything less than 8i (aka 8.1.*)
> then your homework isn't done yet, because ORDER BY is not allowed
> inside a view in Oracle8.0 or lower. BTW, original poster specified
> he/she is using PO7.
>
> > Clement
>
> Regards,
> Jurij Modic <jmodic_at_src.si>
> Certified Oracle7 DBA (OCP)
> ================================================
> The above opinions are mine and do not represent
> any official standpoints of my employer
Received on Fri Mar 26 1999 - 06:15:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US