I'm trying to sum up Customer balances using the following query:
select sum(balance) from mytable where customer = 'john'
However, if the customer has no balance (i.e. no matching rows in the mytable
table), my query returns null and not 0. What's the problem?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…