sql 获取一批指定范围且不重复的随机数

declare @M int,@N int set @m=10 set @n=1 select top 10 cast(rand(checksum(newid()))*(@M-@N)+@n as int) from t_table

posted @ 2014-06-03 20:22  Eric.Z  阅读(508)  评论(0编辑  收藏  举报