Friday, August 31, 2012

Random Sampling in Oracle using Sample Clause

In an earlier post about "Random Sampling using SQL", we use functions mode and dbms_random.random to randomly sample 30% of records.  This can also be done easily with oracle sample clause as the following:
select * from TBL_TEST sample(30);
Sample clause is also a great way to test the performance of a query before we run it on large tables.

2 comments:

Anonymous said...

This is a wonderful website buddy and an informative post!!! i am new here and i found this site very interesting and informative ,, you are a professional blogger i think i have a great interest in such things…thank you for the post buddy and keep on posting nice stuff like this in future as well..
sample research

Jay Zhou, PhD. said...

Thanks.