-6
 (select top 1 percent A from B order by newid())

我想从表 B 中获取随机记录

4

1 回答 1

2

像这样使用...

select * from B where A in 
 (select top 1 percent A from B order by newid())

或者

select top 1 percent A from B order by newid()

两者都会每次都给你随机的行......

编辑 :

从大表中随机选择行

于 2013-02-25T16:32:23.373 回答