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: sampling from a table

Re: sampling from a table

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Thu, 03 Feb 2000 20:07:01 +0800
Message-ID: <38996F65.166B@yahoo.com>


Hagai Katz wrote:
>
> Shalom,
>
> I went fishing for some guidance on how to produce a random sample from a
> large table, but found nothing specific. Could you please assist me as to
> how I can draw a random sample (or any other sampling method: layered,
> clustered, etc) from a database? I will be most greatful if you do.
>
> Please cc it to my eamail: katzh_at_bgumail..bgu.ac.il
>
> Thank you -
>
> Hagai Katz
> Acting Director, The Israeli third-Sector Database,
> ICTR - the Israeli Center for Third-sector Research
> Ben Gurion University of the Negev,
> Beer Sheva, Israel.

If you're on 8i, there is a SAMPLE clause in SQL to do exactly that.

On releases before this, using rownum combined with a random number generator can assist although its not too efficient. A little more complex but more efficient is to generate pseudo-rowid ranges

HTH
--



Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Thu Feb 03 2000 - 06:07:01 CST

Original text of this message

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