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: selecting _only_ the latest ten items

Re: selecting _only_ the latest ten items

From: Jeff Smith <spamnadajsmith_at_provide.net>
Date: Tue, 07 Sep 1999 09:35:20 -0400
Message-ID: <37D51498.A3253324@provide.net>


Pardon me for butting in, but didn't I read somewhere that ROWNUM was assigned prior to the order by?

Jeff

Timo Biesenbach wrote:
>
> Hi,
>
> If you're using Oracle, you may use the rownum pseudocolumn to filter
> your 10 latest rows out :
>
> select * from (select * from news order by date desc)
> where rownum between 0 and 10;
>
> -timo
>
> > What's the best way of selecting, say, the latest 10 news stories from a
> > DB. Do I have to select all the items ordered by date, but just show the
> [...]
> > are displayed, etc.
> >
> > TIA,
> > - Kev
>
> --
> +---+---+-+-+-+-+
> | | |-+-+-+-+ Fraunhofer-Institut fuer Graphische Datenverarbeitung
> +---+---+-+-+-+-+ Fraunhofer-Institute for Computer Graphics
> | | |-+-+-+-+ Abteilung / Department : Document Imaging
> +---+---+-+-+-+-+
> | __ _ | Timo Biesenbach
> | ! ! _ ! \ | Rundeturmstr. 6 phone ++49 6151 155 578
> | ! !__! !_/ | 64283 Darmstadt fax ++49 6151 155 299
> +---------------+ Germany email timo.biesenbach_at_igd.fhg.de
Received on Tue Sep 07 1999 - 08:35:20 CDT

Original text of this message

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