if in mysql advanced code example
Example 1: mysql else if
IF condition1 THEN
statements;
ELSEIF condition2 THEN # OPTIONAL
statements;
ELSE # OPTIONAL
statements;
END IF;
Example 2: if inside select mysql
SELECT IF(1>3,'true','false');