33 ms·
Good article. Another one that I find counter intuitive is that the sum of an empty set returns null which goes against set theory (states it should return 0)
by TomGullen 13y ago
Good article. Another one that I find counter intuitive is that the sum of an empty set returns null which goes against set theory (states it should return 0) but apparently this is by design
- aeorgnoieang 13y agoWhy shouldn't the "sum" of an empty set return 'NULL'? I could understand why a 'count' of an empty set should be 0 (which it is in SQL Server).
- eurleif 13y agosum(A) + sum(B) = sum(A ∪ B) sum(A) + sum({}) = sum(A ∪ {}) sum(A) + sum({}) = sum(A) sum({}) = 0