The PostgreSQL IS NULL operator is used to check if a value is NULL or not. In the world of database Null either means data is missing or not applicable. Hence, it cannot be compared with any integer or string as this kind of comparison always leads to a Null meaning an unknown result.
Syntax: Value IS NULL;
Now, let’s look into a few examples.
Here we will make a query to find all the “first_name” and “last_name” of customers that don’t have an “email” in the “customer” table of our sample database.
SELECT first_name, last_name FROM customer WHERE email IS NULL;
Here we will make a query to find all the “title” of the films that don’t have a “release_year” in the “film” table of our sample database.
SELECT title FROM film WHERE release_year IS NULL;
- PostgreSQL - NOT NULL Constraint
- PostgreSQL - Connect To PostgreSQL Database Server in Python
- PostgreSQL - NOT IN operator
- PostgreSQL - IN operator
- PostgreSQL - NOT LIKE operator
- PostgreSQL - ILIKE operator
- PostgreSQL - LIKE operator
- PostgreSQL - NOT BETWEEN operator
- PostgreSQL - BETWEEN operator
- PostgreSQL - UNION operator
- PostgreSQL - INTERSECT Operator
- PostgreSQL - EXCEPT Operator
- PostgreSQL - ANY Operator
- PostgreSQL - SOME Operator
- PostgreSQL - ALL Operator
- PostgreSQL - EXISTS Operator
- What is PostgreSQL - Introduction
- Install PostgreSQL on Windows
- Install PostgreSQL on Mac
- PostgreSQL - Loading a Database
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.