MySQL provides a nice operator <=>
that works with comparisons that could contain a null such as null <=> null
or null <=> 5
Is there a reason MySql has both and not JUST the functionality in <=> ? The operators are completely different from each other.
<=>
performs an equality comparison like the =
operator, but returns 1
rather than NULL
if both operands are NULL
, and 0
rather than NULL
if one operand is NULL
.
Who really needs an operator that is effectively undefined with built in language types?
This depends on case, just because you haven't encountered such cases, does not mean nobody needs it.