BEGIN
DECLARE count INT DEFAULT 0;
DECLARE js INT DEFAULT 0;
aa:LOOP
SET js = js+1;
IF js = 3 THEN
ITERATE aa; #相当于 CONTINUE
END IF;
SET count = count+1;
IF js=10 THEN
LEAVE aa; #相当于BREAK
END IF;
END LOOP;
SELECT js,count; #10,9
END
MySQL存储过程-LOOP/BREAK/CONTIUNE
最新推荐文章于 2022-10-13 18:54:25 发布