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: AleX <korrozia_at_my-deja.com>
Date: Fri, 10 Sep 1999 00:53:58 GMT
Message-ID: <7r9kqk$bc6$1@nnrp1.deja.com>


I assume that have a field called date_inserted or something like that. If so select all records ordered by this date_inserted and do where rownum<11

That's all.

In article <37D4DCE7.F831494A_at_fast.no>,   kev <kevin.porter_at_fast.no> wrote:
> Hi,
>
> 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
> latest ten. Or is there some SQL I can use which will select only the
> latest 10 from the DB. It could just as easily be the second, or the
> third ten which I want. It's for a website (using PHP) where I want to
> show 10 news stories, then if a user clicks the 'more' link, the next
10
> are displayed, etc.
>
> TIA,
>
> - Kev
>
>

--

                 Alex Shterenberg

"I hate people. I think they should suffer as much as  possible, and therefore I'm into those old communist

         dictatorships." - Euronymous, Mayhem

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Thu Sep 09 1999 - 19:53:58 CDT

Original text of this message

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