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: Help: Need Random sample of 3K from a query returning 100K

Re: Help: Need Random sample of 3K from a query returning 100K

From: Mark D Powell <markp7832_at_my-deja.com>
Date: 2000/04/18
Message-ID: <8dhoss$hvc$1@nnrp1.deja.com>#1/1

In article <8dfg7o$1tr$1_at_nnrp1.deja.com>,   George <ghharrac_at_neodata.com> wrote:
> Can oracle return a Random Sampling (Nthing) of 3K records from 10K
> records/tuples that my select statement returns?
>
> Oracle 8 has a feature to do this but the size of the return
> set is also random, which I cannot use.
>
> The returned data does not have to be statistically sampled.
>
> George
>
> Please directly email me.
>

If the first X number of rows that meet your where clause conditions would do, then you might be able to use the rownum psuedo column as in:

select * from table_x where rownum < Y

where Y is some percentage of the number of rows. You can use the average row length and number of rows in all_tables to calculate Y for limiting it to fitting in Z bytes providing statistics exist on the target table.

>

--
Mark D. Powell  -- The only advice that counts is the advice that
 you follow so follow your own advice --


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Apr 18 2000 - 00:00:00 CDT

Original text of this message

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