IS NOT NULL is used in SQL to see whether there is a value that is not null. True is returned if there is a value that is not null. False otherwise.

Structure

[EXPRESSION] IS NOT NULL

Example

Suppose we want to find a user who has a value that is not null in the deleted_datetime column in the users table. Here’s how to go about it:

SELECT *
FROM users
WHERE deleted_datetime IS NOT NULL;