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 -> does select with sample clause return variable record count

does select with sample clause return variable record count

From: tamsun <tamsun_at_gmail.com>
Date: Mon, 05 Nov 2007 19:06:19 +0800
Message-ID: <fgn1el$ouf$1@news.cn99.com>


hi,

Database version: Oracle Database 10.2.0.2.0 OS: RedHat Enterprise 4

I find select statement with sample clause return random count records, e.g.

select count(*) from ADS_DENDOC;
select count(*) from (select * from ADS_DENDOC sample(1)) a;

1st run:



1302; -- the record count of table ADS_DENDOC 9; -- the record count of sample recordset

2nd run:



1302;
12;

3rd run:



1302;
14;

4th run:



1302;
10;

As Oracle sql reference written,sample_percent is a number specifying the percentage of the total row or block count to be included in the sample. The value must be in the range .000001 to (but not including) 100. Why the record count of sample recordset is variable

Best regards
tamsun Received on Mon Nov 05 2007 - 05:06:19 CST

Original text of this message

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