SQL产生一定范围内的随机数

介绍个通俗的方法
/*产生从N到M的随机整数,假设N、M都是整数*/


declare   @M   int,@N   int

set   @N=6
set   @M=13

select   cast((rand()*(@M-@N)+@N)   as   int)

原文地址:https://www.cnblogs.com/cxd4321/p/1597367.html