介绍个通俗的方法
/*产生从N到M的随机整数,假设N、M都是整数*/
1 declare @M int,@N int 2 3 set @N=6 4 set @M=13 5 6 select cast((rand()*(@M-@N)+@N) as int)
介绍个通俗的方法
/*产生从N到M的随机整数,假设N、M都是整数*/
1 declare @M int,@N int 2 3 set @N=6 4 set @M=13 5 6 select cast((rand()*(@M-@N)+@N) as int)
转载于:https://www.cnblogs.com/lollipop/archive/2012/11/29/2794012.html