I am running this query. Works fine however if NULL result found then it creates exception error in my application. How can I avoid NULL Reference
SELECT SUM(pointsEarned) as earned, SUM(pointsRedeemed) as redeemed
FROM `salesData`
WHERE dealerID = @dealerID and status = 'active'
pointsEarned,pointsRedeemedcan beNULL? If so, look at this answer showing an example usingCOALESCEstackoverflow.com/a/13132245/448144