🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
``` delimiter $$; create procedure test() begin declare mini int default 0; declare max int default 0; select max(id) into max from a; select min(id) into mini from a; myloop:loop if mini % 2= 1 then update a set name='loop' where id =mini; end if; set mini=mini+1; if mini>max then leave myloop; end if; end loop; end $$; ```