Hi Tim,
I guess you can add something like this
to your statement:

SELECT COALESCE( SUM(column) , 0 ) FROM ...

/Johan

Gustafson, Tim wrote:

Is there any way to make sum() return "0" instead of "NULL" when one or
more of the rows being sum()'d is null?

Phrased another way, is there a way to make mySQL treat "NULL" as "0"
when dealing with mathematical functions?

Tim Gustafson
MEI Technology Consulting, Inc
[EMAIL PROTECTED]
(516) 379-0001 Office
(516) 480-1870 Mobile/Emergencies
(516) 908-4185 Fax
http://www.meitech.com/




--
Johan Höök, Pythagoras Engineering Group
                - MailTo:[EMAIL PROTECTED]
                - http://www.pythagoras.se
Pythagoras AB, Stormbyv. 2-4, SE-163 55 SPÅNGA, Sweden
Phone: +46 8 760 00 10 Fax: +46 8 761 22 77


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to