How to use the IS NULL operator

The syntax of the WHERE clause with the IS NULL operator

      WHERE expression IS [NOT] NULL
      

Retrieve all rows

      SELECT orderID, orderDate, shipDate 
      FROM orders;
      
all rows image

Retrieve rows for orders that haven’t been shipped

      SELECT orderID, orderDate, shipDate 
      FROM orders 
      WHERE shipDate IS NULL;
      
NULL image

Retrieve rows for orders that have been shipped

      SELECT orderID, orderDate, shipDate 
      FROM orders 
      WHERE shipDate IS NOT NULL;
      
NOT NULL image

Description

Back