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: How to select random records?

Re: How to select random records?

From: Martin Schroeder <ms_at_dream.hb.north.de>
Date: 1997/09/30
Message-ID: <GdSM0AXFBh108h@dream.hb.north.de>#1/1

In <3430B9DA.B8B_at_bhp.com.au> Connor McDonald <mcdonald.connor.cs_at_bhp.com.au> writes: [...]
>If you have a random number generator - why not just have a cursor along
>the lines of:
 

>cursor x is
> select data, random_number
> from table
> order by 2;
 

>then just select the first "n" rows that you want...

Suppose you want the 655255th record of a table with >1500000 records. You know what a full table scan is, don't you? ;-)

Regards

        Martin

-- 
               Martin Schr"oder, MS_at_Dream.HB.North.DE
Do not go where the path may lead, go instead where there is no path
and leave a trail.                               (Ralph Waldo Emerson)
Received on Tue Sep 30 1997 - 00:00:00 CDT

Original text of this message

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