select sum(if(money > 0, money, 0)) as money from total_money
意思是如果money > 0, 将money的值累加到total_money, 否则将0累加到total_money
本文共 171 字,大约阅读时间需要 1 分钟。
select sum(if(money > 0, money, 0)) as money from total_money
意思是如果money > 0, 将money的值累加到total_money, 否则将0累加到total_money
转载于:https://www.cnblogs.com/ysg520/p/10694194.html