is not distinct from
The not standardized spaceship operator (<=>
) works in some SQL dialects like a null
-safe comparison: It is similar to =
but never returns unknown. Instead it returns false if only one argument is null
or true if both arguments are null
.
SELECT …
FROM …
WHERE c1 <=> c2
Note that this is not a three-way comparison in the way PHP or C++ use the spaceship operator.
Standardised version of this operator: IS NOT DISTINCT FROM
(null-safe equals comparison)
Tutorials:
<=>
is not defined in the SQL standard.
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 all sizes.
Learn more »