mysql結果集存儲過程存儲過程
發布時間: 2022-07-02 05:14:45
delimiter
$$
mysql>
mysql>
CREATE
PROCEDURE
myProc()
//創建while循環的存儲過程
if分支語句示例
->
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)
這種也可以
熱點內容