介绍个通俗的方法 /*产生从N到M的随机整数,假设N、M都是整数*/
declare @M int,@N int
set @N=6 set @M=13
select cast((rand()*(@M-@N)+@N) as int)