时间:2021-07-01 10:21:17 帮助过:28人阅读
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数据库程序设计有所帮助。