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

Home -> Community -> Usenet -> c.d.o.misc -> Sampling a certain percent of rows from a table!

Sampling a certain percent of rows from a table!

From: Asif Haider <asif30779_at_yahoo.com>
Date: 23 Jan 2004 23:10:50 -0800
Message-ID: <419620c0.0401232310.14092ad7@posting.google.com>


Hi,

Can someone explain the following. The total number of rows in the table is 14. So sampling 50% should always give me a count of 7, right? But notice that it shows different outputs for the same same query. Am I being mistaken somewhere?

SQL> select count(*) from emp;

  COUNT(*)


        14

SQL> select count(*) from emp sample(50);

  COUNT(*)


         6

SQL> select count(*) from emp sample(50);

  COUNT(*)


         7

SQL> select count(*) from emp sample(50);

  COUNT(*)


         7

SQL> select count(*) from emp sample(50);

  COUNT(*)


         7

SQL> select count(*) from emp sample(50);

  COUNT(*)


         8

Thanks,
A$!f. Received on Sat Jan 24 2004 - 01:10:50 CST

Original text of this message

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