I would think that if you are looking to know the total of something
(which is what SUM provides), and there is nothing to total, the total
should be 0.  If you want to know if any sales were made, it seems you
should be using COUNT and not SUM.

Just my opinion, of course.

Bob

Envision Information Technologies
Associate
[EMAIL PROTECTED]
v. 608.256.5680
f. 608.256.3780
 

-----Original Message-----
From: Thomas Briggs [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 08, 2005 3:43 PM
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] SUM and NULL values

 

> Can somebody come up with a realistic scenario where they would
> actually want SUM() to return NULL instead of 0?  NULL is such

   I think your example of totaling sales in October makes the argument
itself - you didn't make sales totaling $0 in October, you just didn't
make any sales.  A subtle but irritatingly big difference. :)

   -Tom

Reply via email to