NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
are you sure that works? (Score:1)
SUM( COALESCE( price, 0 ) ) AS totalIf the coalesce is outside the sume, it doesn't fix the underlying issue of apply an aggregate function on a set of data that may contain a NULL value. Or, perhaps I'm missing something...
Reply to This
Re: (Score:1)
SUM ignores NULLs. So the sum of 1 and NULL is 1.
SUM's behavior, of course, makes perfect sense: as 1+NULL yields NULL, so clearly the sum is 1.</sarcasm>