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: How would you retrieve the first five records

Re: How would you retrieve the first five records

From: Doug Cowles <dcowles_at_bigfoot.com>
Date: Sun, 28 Mar 1999 19:31:37 -0500
Message-ID: <36FEC9E9.30027C5E@bigfoot.com>


You can use rownum to restrict the output. Where rownum < 6 for example. But keep in mind, there is no real ordering of the records per se. They don't neccesarrily come out inverse of the way you put them in for example. So it would depend on what your purpose was in getting the first five records. Also, it could vary from one day to the next..

taratatata_at_my-dejanews.com wrote:

> I am new to sql, I want to retrieve the first five records that
> satisfy a condition and get the last record number checked by
> sql.
>
> Let's say I have 10000 records, some 5000 records includes the string
> "dollar", but I need to retrive only the first five records that include
> this string, and I want to get the record number of the first record
> that comes immediatly after the fifth retrieved record.
>
> I check the syntax of "select" but it does not have a way to get my results,
> any help would be very much appreciated.
>
> Thanks everybody.
> Susan
> Toronto, Canada
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Sun Mar 28 1999 - 18:31:37 CST

Original text of this message

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