declare @randnum int=0
declare @startnum int =0
declare @endnum int=0
set @startnum = 150
set @endnum = 200
set @randnum = ROUND(((@endnum - @startnum -1) * RAND() + @startnum), 0)
select @randnum
declare @randnum int=0
declare @startnum int =0
declare @endnum int=0
set @startnum = 150
set @endnum = 200
set @randnum = ROUND(((@endnum - @startnum -1) * RAND() + @startnum), 0)
select @randnum
转载于:https://www.cnblogs.com/xueshui20/p/4078768.html