计算机工程与应用 ›› 2007, Vol. 43 ›› Issue (12): 167-169.

• 数据库与信息处理 • 上一篇    下一篇

一种基于SQL的元组集随机抽取算法

曾强 龚育昌   

  1. 中国科学技术大学计算机系 中国科学技术大学计算机系
  • 收稿日期:2006-05-26 修回日期:1900-01-01 出版日期:2007-04-20 发布日期:2007-04-20
  • 通讯作者: 曾强

A SQL Based Random Algorithm to Abstract Tuple Set

qiang zeng Yu Cang Gong   

  • Received:2006-05-26 Revised:1900-01-01 Online:2007-04-20 Published:2007-04-20
  • Contact: qiang zeng

摘要: 本文提出了一种基于SQL语句的从数据库中随机读取随机记录集合的算法。该算法摒弃了贯用的通过复杂的客户端编程实现随机过程的做法,通过对SQL语言中的伪随机函数和反转函数进行组合,只用一条SQL语句就可以实现随机过程,算法实现简单,资源占有率低,效率高,具有很强的通用性和实用性。

Abstract: A SQL based algorithm to abstract random record set from database is proposed in this paper. To reject the consistently used method which brings about the stochastic process by use of programming at client,the algorithm combines the pseudo-random functions and inverted functions,so it can processes the stochastic process only by one SQL statement.The algorithm is simple,efficiently and costless, so it is very useful.