IS DISTINCT FROM
operator compares two values, considering them distinct even when both are NULL
. It returns TRUE
if the two values are different and FALSE
if they are the same, including the case where both values are NULL
.
value1
is the first value for comparison.value2
is the second value for comparison.NULL
values using the IS DISTINCT FROM
operator:
Example 1
inventory_changes
that tracks changes in the quantities of products in a warehouse. The table has the following structure:
IS DISTINCT FROM
operator can be used.