top | item 22500630

(no title)

carterehsmith | 6 years ago

"SELECT NULL IS NOT DISTINCT FROM NULL" ?column? ---------- t

That bothers me. It is like saying that "infinity" (+inf) equals other infinity. Which is just wrong.

Some other SQL dialects will return "UNKNOWN" rather than "t" (true), which imho makes way more sense.

discuss

order

Tostino|6 years ago

...I think you are misunderstanding the whole reason for the IS NOT DISTINCT FROM operator, which is exactly that.

"SELECT NULL = NULL" will return NULL, use that if you want the standard way. There are many cases where you want it to return true though, and the boilerplate for that sucks, so IS NOT DISTINCT FROM has a very useful place in the dialect.