http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html#function_ifnull
On Wed, Feb 29, 2012 at 13:15, Don Wieland <d...@pointmade.net> wrote: > Little help... > > In my mySQL query editor, I am trying to return a value of 0 when there is > no related rows from this query: > > (select if(count(ip.payment_amount) IS NOT NULL, count(ip.payment_amount) > , 0) FROM tl_trans_pmt_items ip WHERE t.transaction_id = ip.inv_id GROUP > BY ip.inv_id) as d, > > regardless of the combination I use, invalid relationships come back as > NULL - need to return 0 so I can use it in a math formula. > > Probably simple - maybe ;-) > > Don > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql > > -- -- Pythian proud winner of Oracle North America Titan Award for Exadata Solution...watch the video on pythian.com