标签:
CASE 用法:
两种用法:
IF 用法:
ITERATE 仅用于Loop,repeat,while 中;ITERATE,指下一次循环开始。
LEAVE label,退出控制流。
LEAVE
can be used within BEGIN ... END
or loop constructs (LOOP
, REPEAT
, WHILE
).
Loop,
REPEAT,
delimiter //
create procedure dorepeat(p1 int)
begin
set @x=0;
repeat
set @x=@x+1;
until @x>p1
end 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;
标签:
原文地址:http://www.cnblogs.com/itdev/p/5824242.html