We know that when using NULL and comparison operators, we will not get any meaningful result set. To get meaningful results from such comparisons, we can use "IS NULL" and "IS NOT NULL".
mysql> Select 10 IS NULL; +------------+ | 10 IS NULL | +------------+ | 0 | +------------+ 1 row in set (0.00 sec) mysql> Select 10 IS NOT NULL; +----------------+ | 10 IS NOT NULL | +----------------+ | 1 | +----------------+ 1 row in set (0.00 sec)
The above MySQL statement shows the use of "IS NULL" and "IS NOT NULL". The result we get is a Boolean value of 0 (for FALSE) or 1 (for TRUE), which is of course a meaningful result.
The above is the detailed content of What are the benefits of MySQL 'IS NULL' and 'IS NOT NULL'?. For more information, please follow other related articles on the PHP Chinese website!