If NULL means "I don't know" then IMHO the only sensible and logic correct 
thing to do is:

SUM(<empty set>) = 0,
since that conforms to common-sense algebra. Like
   SUM(9, 9, 9) = 3x9 = 27
   SUM(9, 9) = 2x9 = 18
   SUM(9) = 1x9 = 9
   SUM(<empty set>) = 0x9 = 0 and certainly not NULL (I don't know).

I heard someone say that SUM is a binary operation. It is not, because you 
can feed it any number of values. It is not the same as "+".

Not however that this is not valid for all operations. For example:
   MIN(<empty set>) = NULL
   MAX(<empty set>) = NULL
   AVG(<empty set>) = NULL
   COUNT(<empty set>) = 0

However:
SUM(<set with 1 or more NULL values>) = NULL
since 1 of the values is unknown, we can't know the answer

Best regards,
Frank.

Reply via email to