mysql 存储过程中使用 while 循环语句_mysql
mysql>
mysql> delimiter $$
mysql>
mysql> create procedure myproc()
-> begin
->
-> declare i int;
-> set i=1;
-> loop1: while i<=10 do
-> if mod(i,2)<>0 then /*even number - try again*/
-> select concat(i," is an odd number");
-> end if;
-> set i=i+1;
-> end while loop1;
-> end$$
query ok, 0 rows affected (0.00 sec)
mysql>
mysql> delimiter ;
mysql> call myproc();
以上就是mysql 存储过程中使用 while 循环语句_mysql的内容。