Loading

Sqlserver 在大表中获取 Select 随即记录(English)

Selecting Rows Randomly from a Large Table

http://msdn.microsoft.com/en-us/library/cc441928.aspx

语句如下:

 SELECT * FROM Table1
  WHERE (ABS(CAST(
  (BINARY_CHECKSUM
  (keycol1, NEWID())) as int))
  % 100) < 10

 

select top 1 * from 
Table1 TABLESAMPLE(1000 ROWS) 

 

posted @ 2013-04-06 14:42  chear  阅读(1007)  评论(0编辑  收藏  举报