当前位置: 代码迷 >> Sql Server >> 取随便数重复的有关问题
  详细解决方案

取随便数重复的有关问题

热度:57   发布时间:2016-04-27 20:24:02.0
取随便数重复的问题
select   id,rand()*90   as   b   from     Pub_Personnel  

b   列取出的数据都是一样的,有没有办法可以每条记录得到自己的值


------解决方案--------------------
select id, cast(rand()*90 as int)+1 as b from Pub_Personnel

------解决方案--------------------
select id,rand()*90.0 as b from Pub_Personnel
------解决方案--------------------
都说了
------解决方案--------------------
select id,rand(id)*90 as b from Pub_Personnel
  相关解决方案