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