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

Home -> Community -> Usenet -> c.d.o.tools -> Re: NEWBIE: Limit Rows Returned by Select ?

Re: NEWBIE: Limit Rows Returned by Select ?

From: <moerkd_at_my-deja.com>
Date: Fri, 06 Oct 2000 11:18:59 GMT
Message-ID: <8rkcev$ah$1@nnrp1.deja.com>

If you user rownum, you don_t need the order by clause. Rownum doesn't sort at all.

DET In article <8rk0t1$cvk1q$1_at_reader3.wxs.nl>,   "Arie Mars" <arie_at_pca-online.nl> wrote:
> select * from system_history
> WHERE ROWNUM<=1000
> order by primary_key desc
>
> or use more meaningfull criteria like
> WHERE employeenr < 12345 or
> WHERE UPPER(CITY) = 'AMSTERDAM'
> or whatever
>
> Arie Mars
> arie_at_pca-online.nl
>
> Steve Cholerton <stevechol_at_freeuk.com> schreef in berichtnieuws
> fgaptss9ej6ipq414mv2svj87t9dfrguq8_at_4ax.com...
> > Hi all
> > Can anybody advise me if there is a way to limit the number of rows
> > returned by a select statement, I have a select statement alsong the
> > following lines:
> >
> > select * from system_history order by primary_key desc
> >
> > I only want the last thousand rows ... is this possible ?
> > Many thanx
> > -Steve
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Oct 06 2000 - 06:18:59 CDT

Original text of this message

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