我想获取金额不是= 0
我的查询
select c.c_name, sum(cp.invoice_amount)-sum(cp.recived_amount) as amount from customer_payments cp
inner join customer c on c.c_id = cp.customer_id group by c.c_name
从中我得到的所有客户的结果也是0。
答案 0 :(得分:0)
您正在寻找HAVING
命令
将此添加到最后
having amount <> 0