3 ms·
Having done SQL development for a long time I think while that is technically correct in practice it causes too many issues and is a mistake. Many values in a
by SigmundA 9y ago
Having done SQL development for a long time I think while that is technically correct in practice it causes too many issues and is a mistake.
Many values in a database are approximate especially if representing real world values, but in our logic we treat them as equal even if they really aren't exactly equal, because that's practical. At least GROUP BY / aggreagates treats null equal, this was done for practicality and is a special exception which drives home the point.
In the end x == y OR (x IS NULL AND y IS NULL) simply wastes my time and adds no value to me along with the other issues that come with not simply allowing x == y checks like every normal programming language I use.
- IncRnd 9y agoWithout a doubt. The root of many difficulties is SQL-X using NULL as a Not Set State instead of as a Value. However, Value representations have their own issues, which can be seen in vulnerabilities that have occurred in non-SQL where the corresponding checks had not been performed. In response to this is error based exceptions. Tradeoffs that we all live with.