MySQL ISNULL Function

Example

Test whether an expression is NULL:

SELECT ISNULL(NULL);

Definition and Usage

The ISNULL() function returns 1 or 0 depending on whether an expression is NULL.

If expression is NULL, this function returns 1. Otherwise, it returns 0.

Syntax

ISNULL(expression)

Continue reading MySQL ISNULL Function

MySQL IFNULL Function

Example

Return the specified value IF the expression is NULL, otherwise return the expression:

SELECT IFNULL(NULL, "Iampsp.com");

Definition and Usage

The IFNULL() function returns a specified value if the expression is NULL.

If the expression is NOT NULL, this function returns the expression.

Syntax

IFNULL(expression, alt_value)

Continue reading MySQL IFNULL Function