<=>
is
operator insteadThe not-equals comparison (<>
) returns unknown if one of the compared values is the null
value. Is distinct from
is similar to <>
except that it never returns unknown. Instead it returns true if only one argument is null
or false if both arguments are null
.
SELECT …
FROM …
WHERE c1 IS DISTINCT FROM c2
Negation: IS NOT DISTINCT FROM
(null-safe equals comparison)
Tutorials:
Is distinct from
is defined in ISO/IEC 9075-2:2016 as the optional feature T151, “DISTINCT predicate”.
The essence of SQL tuning in 200 pages
Buy now!
(paperback and/or PDF)
Paperback also available at Amazon.com.
Markus offers SQL training and consulting for developers working at companies of any size.
Learn more »