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

Re: selecting _only_ the latest ten items

From: Timo Biesenbach <tbiesenb_at_igd.fhg.de>
Date: Tue, 07 Sep 1999 14:07:53 +0200
Message-ID: <37D50019.C8DF94DF@igd.fhg.de>


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 - 07:07:53 CDT

Original text of this message

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