mysql 循环使用
delimiter $$drop procedure if exists lopp;
create procedure lopp()
begin
declare i int ;
set i = 1;
lp1 : LOOP //lp1 为循环体名称 LOOP 为关键字
insert into user_profile (uid) values (i);
set i = i+1;
if i > 30 then
leave lp1; //离开循环体
end if;
end LOOP; //结束循环end $$
页:
[1]