I am compiling a list of leading data providers. This is the current list. If your favorite data providers are not included here and you feel they should be, please contact me at firstname.lastname@example.org. Thanks. Dr. Zhou.
Wednesday, October 03, 2012
More on random sampling in Oracle
The earlier post Random Sampling using SQL uses dbms_random.random to generate random numbers. A better function is dbms_random.value which generates uniformly distributed random number greater than or equal to 0 and less than 1. We can rewrite random sampling scripts as the following. Step 1 . Create random numbers. create table tbl_app_id_w_rnd as select app_id, dbms_random.value rnd from CELL_PHONE_SERVICE_APPS; Step 2. Create a view that contains 30% of the records. create view v_data_testing as select a.* from CELL_PHONE_SERVICE_APPS a, tbl_app_id_w_rnd b where a.app_id=b.app_id and rnd <=0.3;