Conditional functions

The following table describes the supported conditional functions.

Function Description
IF Returns one value if a condition is true, and another value if the condition is false.
IFNULL Returns the specified alternative value if the given expression is NULL; otherwise, returns the expression itself.
NULLIF Compares two expressions and returns NULL if they are equal; otherwise, returns the first expression.
CASE Implements conditional branching by evaluating conditions in a sequence. Returns the result of the first condition that is true.
COALESCE Returns the first non-NULL expression from a list of expressions.

For more information, see the MySQL documentation: Flow Control Functions and Comparison Functions and Operators.