MySQL: IS NOT NULL Condition

Profile picture for user arilio666

The IS NOT NULL is a condition used in MySQL to fetch the record of data in a table where there is no null value present or we can say complete data.


SELECT * from TableName WHERE ColumnName IS NOT NULL;

We will use the orders table for this example:

Today we will be doing some basic operations using IS NOT NULL: We will be fetching orders which are shipped from the orders table.


select * from orders where shipped_date IS NOT NULL;

As we can see the shipped date are the orders which are successfully delivered date as we need to fetch orders that are shipped,so we can use the IS NOT NULL condition to fetch the dates which are not null meaning that they are shipped.