Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Randomly pick

Re: Randomly pick

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Wed, 10 Jan 2001 18:58:40 -0000
Message-ID: <979152957.3384.0.nnrp-09.9e984b29@news.demon.co.uk>

In Oracle 8.1.6 you could use the new SAMPLE clause:

select * from big_table sample (1);

would produce a random sample of about 1% or the rows. To get 100,000 from 10,000,000 try a 1.05% sample, then stop after the first 100,000 rows.

--
Jonathan Lewis
Yet another Oracle-related web site:  http://www.jlcomp.demon.co.uk

Practical Oracle 8i:  Building Efficient Databases

Publishers:  Addison-Wesley
See a first review at:
http://www.ixora.com.au/resources/index.htm#practical_8i
More reviews at: http://www.jlcomp.demon.co.uk/book_rev.html



Anna Henson wrote in message ...

>Dear Oracle users,
>
>Please show me how to write a query to randomly picked 100,000 accounts
from
>a table that has about 10 million accounts.
>Thank you for your help.
>
>
>Anna Henson
>
>
Received on Wed Jan 10 2001 - 12:58:40 CST

Original text of this message

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