UPDATE account INNER JOIN
(SELECT c1.user, sum(c1.total_1) as sumc
FROM c1
GROUP BY c1.user
) c1
ON c1.user = account.u_id
SET account.amount = account.amount + sumc
WHERE account.t_ype = 8 ;
Sign up to request clarification or add additional context in comments.
Comments
1
UPDATE account
JOIN
(
select user, sum(total_1) as sum_total
from c1
group by user
) c1 ON c1.user = account.u_id
SET account.amount = account.amount + sum_total
WHERE account.t_ype = 8