|
|
|
|
|
by Pxtl
525 days ago
|
|
> SQL NULLs aren't weird, they're just based off of Kleene's TRUE-FALSE-UNKNOWN logic! Kleene's TRUE-FALSE-UNKNOWN logic is weird. SQL nulls effectively violate the reflexive property of equality, because X=X does not result in a value of TRUE. And in many contexts in SQL, NULL is treated as equivalent to false, such as within a WHERE clause. So that means that X=X is effectively FALSE in SQL*. That is a clown language. *(yes, I have the same opinion about ANSI NaN, but that wouldn't come up so often if Javascript didn't love NaN for some stupid reason.) |
|
NULL is not equivalent to FALSE, it is neither FALSE nor TRUE. It has the same effect as FALSE as the final result of evaluating a WHERE clause condition only because WHERE clause conditions allow a row to be included only when they evaluate strictly to TRUE. But if NULL were equivalent to FALSE in a WHERE clause, than a WHERE clause condition which would evaluate to NULL that was instead negated would be equivalent to TRUE but instead it remains NULL which remains not TRUE.