复制代码 代码如下:
Declare @CurrentRecord int,@BeginNum int, @EndNum int, @TotalCount int,@Value int
set @BeginNum=0
set @EndNum=500
set @TotalCount=80
set @CurrentRecord=1
While @CurrentRecord=@TotalCount
Begin
set @Value= @BeginNum+(@EndNum - @BeginNum)*rand()
update [tableName] set [columnName] = @Value where [IDColumnName] = @CurrentRecord
set @CurrentRecord=@CurrentRecord+1
End
您可能感兴趣的文章:- mysql 某字段插入随机数(插入随机数到MySQL数据库)
- 从MySQL数据库表中取出随机数据的代码
- 利用tcpdump对mysql进行抓包操作技巧