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

Home -> Community -> Usenet -> c.d.o.misc -> Re: how to limit the output?

Re: how to limit the output?

From: Steve McDaniels <steve.mcdaniels_at_sierra.com>
Date: Tue, 26 Oct 1999 13:16:20 -0700
Message-ID: <7v52bc$6hn$1@plo.sierra.com>


select * from
( select field1, field2, ... from table_T where <blah blah> order by fieldn , etc)
where rownum <= 3
/

kev <kevin.porter_at_fast.no> wrote in message news:3815ACEB.E5D50D25_at_fast.no...
> Brian Peasland wrote:
>
> > Try:
> >
> > SELECT * FROM table WHERE ROWNUM <= 3;
> >
>
> On 8.0.5 this doesn't work if you have an ORDER BY clause, because Oracle
> works out the rownum before it does the ORDER BY.
>
> I've heard that that behaviour has changed in 8.1.5. Can anyone confirm
> this?
> I would _really_ like to use rownums and ORDER BYs.
>
> thanks,
>
> - Kev
>
>
Received on Tue Oct 26 1999 - 15:16:20 CDT

Original text of this message

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