sql随机数

1 select cast(floor(rand()*20) as int)+1 as P_jsnews_id
2 
3  select top 20 * from P_jsnews where P_jsnews_id>(select cast(floor(rand()*1000) as int)+1 as P_jsnews_id)
4 
5 select   top 20  * from   P_jsnews   order   by   newid()
原文地址:https://www.cnblogs.com/dqh123/p/9469988.html