sql 随机数高效率算法

Declare @d Datetime
Set @d=getdate()
SELECT Top 1* FROM [user_info]
WHERE 0.01 >= CAST(CHECKSUM(NEWID(), [id]) & 0x7fffffff AS float) / CAST (0x7fffffff AS int)
Select [语句执行花费时间(毫秒)] = Datediff(ms,@d,Getdate())

posted @ 2012-07-25 15:44  赤狐(zcm123)  阅读(201)  评论(0编辑  收藏  举报