Last Updated : 12 Jul, 2025
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.
SyntaxMySQL ISNULL() function syntax is:
ISNULL(expression)
Parameters:
The MySQL ISNULL function is supported on following versions:
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 1Implementing ISNULL() function.
SELECT ISNULL(NULL);
Output:
1Example 2
Implementing ISNULL() function on a string.
SELECT ISNULL("gfg");
Output:
0Example 3
Implementing ISNULL() function on an integer value.
SELECT ISNULL(123);
Output:
0Important Points About MySQL ISNULL() Function
- The ISNULL() function is used to check if a value is NULL or not.
- It returns 1 if the expression is NULL, otherwise it returns 0.
- It can be used in SELECT, WHERE, and other clauses.
- It is different from the IFNULL() function, which is the MySQL equivalent of SQL Server's ISNULL().
- It is useful for handling NULL values in queries and filtering rows where a column is NULL or not NULL.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4