Mega Code Archive
The IF() function compares three expressions, as shown in the following syntax
mysql>
IF(, ,
If evaluates to true, then the function returns ;
otherwise, the function returns .
mysql>
mysql> SELECT IF(10>20, 'expression correct', 'expression incorrect');
+---------------------------------------------------------+
| IF(10>20, 'expression correct', 'expression incorrect') |
+---------------------------------------------------------+
| expression incorrect |
+---------------------------------------------------------+
1 row in set (0.00 sec)
mysql>