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: Connor McDonald <mcdonald.connor.cs_at_bhp.com.au>
Date: 1997/10/03
Message-ID: <343473AE.143F@bhp.com.au>#1/1

Martin Schroeder wrote:
>
> 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)

Yeh - fair enough....but hey...that's what RAM for...big sorts..!!!

(hee hee)



Connor McDonald
BHP Information Technology
Perth
Australia
email: mcdonald.connor.cs_at_bhp.com.au
"My views are not BHP ...blah blah"

"Opera singers are the only people that when you  stick a knife in them, they sing, not bleed" Received on Fri Oct 03 1997 - 00:00:00 CDT

Original text of this message

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