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: Order By Problem

Re: Order By Problem

From: Shaojie Hu <maichen_at_rols.com>
Date: Mon, 17 Jan 2000 18:17:46 -0600
Message-ID: <8607qb$spc$1@bob.news.rcn.net>


Actually, I want to do something like:
select * from (select x.*, rownum r from foo

                      order by col1)

where r between (PageNo - 1) * NoPerPage + 1 and PageNo * NoPerPage;

see, move ORDER BY to outer query would not give me the correct results.

spencer <spencerp_at_swbell.net> wrote in message news:5cNg4.526$%_6.3670_at_nnrp2.rcsntx.swbell.net...
> move the ORDER BY to the outer query.
>
>
> "Shaojie Hu" <maichen_at_rols.com> wrote in message
> news:8605vb$hmn$1_at_bob.news.rcn.net...
> > Hi, All:
> >
> > Oracle does not allow to use Order By clause in subquery, how
> do I solve the
> > problem?
> > what I want is something like this:
> >
> > select * from (select x.*, rownum r from foo
> > order by col1);
> >
> > Thanks.
> >
> >
>
>
Received on Mon Jan 17 2000 - 18:17:46 CST

Original text of this message

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