UPDATE contacts_cstm AS cst 
LEFT JOIN (SELECT SUM(i.inv_balance) AS total_assets, sc.se_investments_contactscontacts_ida AS contact_id
FROM se_investments i
JOIN se_investments_contacts_c sc ON sc.se_investments_contactsse_investments_idb = i.id
WHERE i.type = 'Superannuation'
AND i.inv_balance !=0
AND sc.deleted = 0 
GROUP BY sc.se_investments_contactscontacts_ida ) AS c
ON cst.id_c = c.contact_id
SET cst.assets_total_super_c = c.total_assets;
