if function mysql code example
Example 1: mysql if else
IF condition THEN
statements;
ELSE
else-statements;
END IF;
Example 2: if inside select mysql
SELECT IF(1>3,'true','false');
IF condition THEN
statements;
ELSE
else-statements;
END IF;
SELECT IF(1>3,'true','false');