- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the benefit of MySQL ‘IS NULL’ and ‘IS NOT NULL’?
As we know that while using NULL with a comparison operator, we would not get any meaningful result set. To get the meaningful result from such kind of comparisons, we can use ‘IS NULL’ and ‘IS NOT NULL’.
Example
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 MySQL statements above show the use of ‘IS NULL’ and ‘IS NOT NULL’. We got the result in Boolean values either 0 (for FALSE) or 1(for TRUE) which is certainly a meaningful result.
- Related Articles
- In MySQL what is the difference between != NULL and IS NOT NULL?
- Difference Between MySql NULL and IS NOT NULL?
- Working with NULL and IS NOT NULL in MySQL
- What is MySQL NOT NULL constraint and how can we declare a field NOT NULL while creating a table?
- Insert default into not null column if value is null in MySQL?
- What is the difference between MySQL ISNULL() function and IS NULL operator?
- Display only NOT NULL values from a column with NULL and NOT NULL records in MySQL
- Return null for date_format when input is null in MySQL?
- What MySQL returns if the argument of QUOTE() function is NULL?
- What is the benefit of zerofill in MySQL?
- Conditional NOT NULL case MySQL?
- Display NULL and NOT NULL records except a single specific value in MySQL
- CASE WHEN column1 IS NULL THEN NULL ELSE column2 END with MySQL
- What will happen if a NULL value is detected for a SQL statement in COBOL-DB2 program and the NULL indicator is not used?
- What MySQL returns if the first argument of INTERVAL() function is NULL?

Advertisements