3 ms·
>That's not really NULL's fault that it causes confusion in SQL. That's just ternary logic The problem is that its not simply ternary logic. It's a ternary log
by setr 8y ago
>That's not really NULL's fault that it causes confusion in SQL. That's just ternary logic
The problem is that its not simply ternary logic. It's a ternary logic that gets mapped onto a boolean algebra, which leads to the usual strange repercussions (particularly, the presence of nulls creates both false positives, and false negatives, silently).
The SQL language goes out of its way to pretend its not ternary, though in fact it is. You have to actively keep in mind when writing SQL that the database is trying to trick you. This is not a good thing, and it's hard to blame the programmer when they get tricked.