Ggf. brauchst du den Group ja doch nicht?

set x.f5 = coalesce((select sum bla von oben..... where x.f4 = a.f4), x.f5)
where bla