In this guide, we will explain how to use the MySQL ISNULL function with syntax and examples.
Description
The MySQL ISNULL function tests whether an expression is NULL.
Syntax
The syntax for the ISNULL function is:
ISNULL( expression )
Parameters or Arguments
expression
The value to test if NULL.
Note
- If expression is a NULL value, the ISNULL function will return 1.
- If expression is not a NULL value, the ISNULL function will return 0.
Applies To
The ISNULL function can be used in the following versions :
- MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23
Example
Let’s look at some ISNULL function examples and explore how to use the ISNULL function.
For example:
mysql> SELECT ISNULL('adglob.in'); Result: 0 mysql> SELECT ISNULL(''); Result: 0 mysql> SELECT ISNULL(NULL); Result: 1 mysql> SELECT ISNULL(28); Result: 0
Next Topic : Click Here
Pingback: MySQL: IFNULL Function | Adglob Infosystem Pvt Ltd