CASE 用法:
两种用法:
IF 用法:
循环语句:
ITERATE Syntax
ITERATE 仅用于Loop,repeat,while 中;ITERATE,指下一次循环开始。
14.6.5.4 LEAVE Syntax
LEAVE label,退出控制流。
can be used within or loop constructs (, , ).
Loop,
REPEAT,
delimiter //
create procedure dorepeat(p1 int)beginset @x=0;repeat set @x=@x+1;until @x>p1end repeat;select @x;end //call dorepeat(1000);WHILE,
CREATE PROCEDURE dowhile()BEGIN DECLARE v1 INT DEFAULT 5; WHILE v1 > 0 DO ... SET v1 = v1 - 1; END WHILE;END;