It surprised me that the sum over 0 rows comes to null and not zero.

DROP TABLE IF EXISTS x;
CREATE TABLE x (val INTEGER);
SELECT sum(val) FROM x;

I checked and it does the same in mysql, but was wondering
  a) why is it like this? if its because of a standard, again why is the
standard like that?
  b) is there a way around this (other than 'isnull(sum(val),0)'  )?
  c) maybe it should be in the docs about the function. Its an unobvious
behaviour.

- mike

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to