mysql 简单数据插入存储过程

create procedure a()
begin
declare num int;
set num=20402;
la:loop
if(num<=20451) then
begin
insert into Moneys (loginId,moneys) values (num,200);
set num=num+1;
end;
else
leave la;//退出循环
end if;
end loop;
end

 比较简单!

你可能感兴趣的:(mysql)