Overview
TheIS NOT DISTINCT FROM operator is a counterpart to IS DISTINCT FROM.
It compares two values, treating them as equal even when they are both NULL. This operator returns TRUE if the two values are the same, including the case where both values are NULL and FALSE if they are different.
Syntax
The syntax for the operator is as follows:- value1is the first value for comparison.
- value2is the second value for comparison.
Examples
Case #1: Basic Usage
Consider the following example where we compare two values: Example 1Case #2: Comparing NULL Values
In this example, we’ll compare NULL values using the IS NOT DISTINCT FROM operator: Example 1Case #3: Analyzing Data Completeness
Suppose we have a table named customer_contacts that stores customer contact information.customer_contacts table where the email and phone are NULL. We can conclude that the customer with customer_id 104 has no phone number or email address.