ITPUB??ì3
12月微软Hyper-V虚拟化沙龙主题征集
ITPUB论坛 » Oracle开发 » 随机取样:select * from XXX sample(50)

标题: 随机取样:select * from XXX sample(50)
在线/呼叫 biti_rainy
人生就是如此



精华贴数 38
个人空间 0
技术积分 111199 (4)
社区积分 11832 (132)
注册日期 2001-12-12
论坛徽章:41
现任管理团队成员ITPUB长老会成员ITPUB元老年度论坛发贴之星年度论坛发贴之星ITPUB北京九华山庄2008年会纪念徽章
管理团队2007贡献徽章参与2007年甲骨文全球大会(中国上海)纪念ITPUB北京香山2007年会纪念徽章管理团队2006纪念徽章会员2007贡献徽章会员2006贡献徽章

发表于 2002-1-18 13:36 
随机取样:select * from XXX sample(50)

sample这玩意到底是指什么啊
难道出多次随机取样查询出来的记录数的平均值为50%

查了半天也没有找着




__________________
眼界决定边界,态度决定高度
blog:
人生就是如此
只看该作者    顶部
离线 hyacinth
学无止境



精华贴数 1
个人空间 0
技术积分 792 (2435)
社区积分 181 (2565)
注册日期 2002-1-7
论坛徽章:2
ITPUB元老授权会员    
      

发表于 2002-1-18 15:26 
The sample_clause lets you instruct Oracle to select from a random sample of rows from the table, rather than from the entire
table.
BLOCK
BLOCK instructs Oracle to perform random block sampling instead of random row sampling.
See Also: Oracle8i Concepts for a discussion of the difference

sample_percent
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.
Restrictions on the sample_clause:
You can specify SAMPLE only in a query that selects from a single table. Joins are not supported. However, you can achieve
the same results by using a CREATE TABLE ... AS SELECT query to materialize a sample of an underlying table and then rewrite
the original query to refer to the newly created table sample. If you wish, you can write additional queries to materialize
samples for other tables.
See Also: "SAMPLE Examples"  
When you specify SAMPLE, Oracle automatically uses cost-based optimization. Rule-based optimization is not supported with
this clause.

Caution: The use of statistically incorrect assumptions when using this feature can lead to
incorrect or undesirable results. Refer to Oracle8i Concepts for more information on using
the sample_clause.  

这是我找的,看看对你有没有帮助


__________________
没有比人更高的山,        没有比脚更长的路.Email: Hyacinth@itpub.net
只看该作者    顶部
 
    

相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问