MySQL :: MySQL 8.4 Reference Manual :: 15.6.5 Flow Control Statements (original) (raw)

15.6.5 Flow Control Statements

15.6.5.1 CASE Statement

15.6.5.2 IF Statement

15.6.5.3 ITERATE Statement

15.6.5.4 LEAVE Statement

15.6.5.5 LOOP Statement

15.6.5.6 REPEAT Statement

15.6.5.7 RETURN Statement

15.6.5.8 WHILE Statement

MySQL supports the IF,CASE,ITERATE,LEAVE LOOP,WHILE, andREPEAT constructs for flow control within stored programs. It also supportsRETURN within stored functions.

Many of these constructs contain other statements, as indicated by the grammar specifications in the following sections. Such constructs may be nested. For example, anIF statement might contain aWHILE loop, which itself contains aCASE statement.

MySQL does not support FOR loops.