Re: simple SQL question

From: kev <kevin.porter_at_fast.no>
Date: 1999/08/04
Message-ID: <37A84022.E177CFA1_at_fast.no>#1/1


Fair comment, but my question applies to any sort of data, not just temporal. Anyway, I am storing my 'time' as a Unix timestamp and I just want to retrieve the rows with the top 10 (highest) values.

I'm suspicious of rownum - any gurus tell me if this would work as I described above:

select rownum r, headline, timestamp
from news where rownum between 1 and 3
order by timestamp;

Thanks,

  • Kev

Kenneth C Stahl wrote:

> That would go against the concept of a relational database. If you want
> information like that then you would need to provide a DATE column -
> however, it's granularity is only to seconds and if rows are being
> inserted at a fast clip then it may not be as useful as you require.
>
> kev wrote:
>
> > Hi,
> >
> > Just wondering - what's the best way to retrieve, say, the latest ten
> > entries to a table.
> > Does Oracle have a MAXROWS func (I couldn't find one in the docs)
> >
> > Thanks,
> >
> > - Kev

--
Kevin Porter
Web Programmer
FAST Web Media
Suite 320, Sunlight House, Quay St, Manchester
England, M3 3JZ

Phone:  44 (0) 161 835 3525
Email:  kevin.porter_at_fast.no
Home Page:              http://www.fast.no
All The Web:            http://www.alltheweb.com
FAST FTP Search:        http://ftpsearch.lycos.com
FAST MP3:               http://mp3.lycos.com
FAST Soccer:            http://www.fa-premier.com
FAST Entertainment:     http://www.innit.com
Received on Wed Aug 04 1999 - 00:00:00 CEST

Original text of this message