Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: does select with sample clause return variable record count
fitzjarrell_at_cox.net wrote:
> Comments embedded.
> On Nov 5, 5:06 am, tamsun <tam..._at_gmail.com> wrote:
>> 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
thank you, David. Received on Mon Nov 05 2007 - 19:53:46 CST