Mysql使用汇总

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xingfuzhijianxia/article/details/78426072

1. 需求是执行批量更新某表数据 id (UUID)

delimiter //
create procedure proc_update_ids() 
begin
declare num int; 
set num=5; 
while num <= 31 do 
	UPDATE base_server_info SET id=(SELECT UUID()) WHERE dbid=num;
set num=num+1;
end while;
end
 //

使用如下:

CALL  proc_update_ids()


未完,待续...


猜你喜欢

转载自blog.csdn.net/xingfuzhijianxia/article/details/78426072