SELECT
FLOOR(RAND(ABS(CHECKSUM(NEWID()))) * 100) AS Rnd,
id,
name
FROM MyTable
FLOOR(RAND(ABS(CHECKSUM(NEWID()))) * 100) AS Rnd,
id,
name
FROM MyTable
ORDER BY Rnd DESC
FLOOR(RAND(ABS(CHECKSUM(NEWID()))) * 100) --可以得到0~99之间的随机数
你可以用此句算概率什么的,如果要随机得到记录,则用
selecttop N * from MyTable orderby newid() ----N是一个你指定的整数,表是取得记录的条数
AUTHOR:Ryan.Zhu
FROM: http://www.cnblogs.com/flysnow-z/archive/2012/03/07/2383637.html