Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Help: Need Random sample of 3K from a query returning 100K
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