MySQL supports the MySQL支持IF
, CASE
, ITERATE
, LEAVE
LOOP
, WHILE
, and REPEAT
constructs for flow control within stored programs. IF
、CASE
、ITERATE
、LEAVE
LOOP
、WHILE
和REPEAT
构造,用于存储程序中的流控制。It also supports 它还支持在存储函数中使用RETURN
within stored functions.RETURN
。
Many of these constructs contain other statements, as indicated by the grammar specifications in the following sections. 这些构造中的许多都包含其他语句,如下面几节中的语法规范所示。Such constructs may be nested. 这种构造可以嵌套。For example, an 例如,IF
statement might contain a WHILE
loop, which itself contains a CASE
statement.IF
语句可能包含WHILE
循环,WHILE
循环本身包含CASE
语句。
MySQL does not support MySQL不支持FOR
loops.FOR
循环。