adding if else to a function mysql code example
Example 1: mysql else if
IF condition1 THEN
statements;
ELSEIF condition2 THEN # OPTIONAL
statements;
ELSE # OPTIONAL
statements;
END IF;
Example 2: mysql if else
IF condition THEN
statements;
ELSE
else-statements;
END IF;