无详细内容 MySQL mysqlmysql delimiter $$mysqlmysql 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; - SE
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();
本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉
本文系统来源:php中文网