I\'m finding some problems with a query that returns the sum of a field from a table for all the records that meet certain conditions. I expected to receive a \"No records f
use the coalesce function of mysql and do:
SELECT COALESCE(SUM(where),0) FROM table WHERE condition = variable