MySQL ISNULL( ) Function (original) (raw)

Last Updated : 06 Jun, 2024

The **MySQL ISNULL() function is used for checking whether an expression is NULL or not.

This function returns 1 if the expression passed is NULL; otherwise, it returns 0. The **ISNULL() function in MySQL accepts the expression as a parameter and returns an integer with a value of a value 0 or 1 depending on the parameter passed.

**Syntax

MySQL ISNULL() function syntax is:

ISNULL(expression)

**Parameters:

**Supported Versions of MySQL

The MySQL ISNULL function is supported on following versions:

MySQL ISNULL( ) Function Example

Let’s look at some examples of the ISNULL() function in MySQL. Learning the ISNULL() function with examples will help in understanding the concept better.

**Example 1

Implementing ISNULL() function.

**SELECT ISNULL(NULL);

**Output:

1

**Example 2

Implementing ISNULL() function on a string.

**SELECT ISNULL("gfg");

**Output:

0

**Example 3

Implementing ISNULL() function on an integer value.

**SELECT ISNULL(123);

**Output:

0

Important Points About MySQL ISNULL() Function