Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: sampling from a table
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
--
"Some days you're the pigeon, and some days you're the statue." Received on Thu Feb 03 2000 - 06:07:01 CST
![]() |
![]() |