- 15.6.5.1 CASE 语句15.6.5.1 CASE Statement
- 15.6.5.2 IF 语句15.6.5.2 IF Statement
- 15.6.5.3 ITERATE 语句15.6.5.3 ITERATE Statement
- 15.6.5.4 LEAVE 语句15.6.5.4 LEAVE Statement
- 15.6.5.5 LOOP 语句15.6.5.5 LOOP Statement
- 15.6.5.6 REPEAT 语句15.6.5.6 REPEAT Statement
- 15.6.5.7 RETURN 语句15.6.5.7 RETURN Statement
- 15.6.5.8 而 Statement15.6.5.8 WHILE Statement
MySQL 支持 IF, CASE, ITERATE, LEAVE LOOP, WHILE以及 REPEAT 构造,用于存储程序中的流控制。它还支持 RETURN“。MySQL supports the IF,
CASE,
ITERATE,
LEAVE
LOOP,
WHILE, and
REPEAT constructs for flow control
within stored programs. It also supports
RETURN within stored functions.
许多这些结构包含其他语句,如以下章节的语法规范所示。这些结构可以嵌套。例如,IF 语句可能包含 WHILE 循环,该循环本身包含一个 CASE 语句。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.
MySQL 不支持 FOR 循环。MySQL does not support FOR loops.