mysql sum

SUM(if(pay_status=4 or pay_status=5 or pay_status=-1,amount,0)) as canWithDraw,SUM(if(pay_status=2,amount,0)) as toBeSettled,sum(freight) as freight

你可能感兴趣的:(数据库架构)