mysql else if 1

mysql else if

IF condition1 THEN
    statements;
ELSEIF condition2 THEN # OPTIONAL
	statements;
ELSE # OPTIONAL
    statements;
END IF;

Here is what the above code is Doing:
1. If condition1 is true, then execute the statements.
2. If condition1 is false, then check if condition2 is true. If condition2 is true, then execute the statements.
3. If condition1 and condition2 are both false, then execute the statements.

Similar Posts