I have tried this :
update customers set customers.acc_balance = (select sum (invoices.inv_amount) from customers left join invoices on customers.cust_id=invoices.cust_id group by customers.cust_id)
this
update customers set customers.acc_balance = (select sum (invoices.inv_amount) from customers inner join invoices on customers.cust_id=invoices.cust_id group by customers.cust_id)
error is :
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
when i try this :
this
update customers set customers.acc_balance = (select sum (invoices.inv_amount) from customers left join invoices on customers.cust_id=invoices.cust_id group by customers.cust_id) where invoices.cust_id = customers.cust_id
error is :
The multi-part identifier "invoices.cust_id" could not be bound.
anyone knows what to do next ?