update zy_sys2_ypzdk set pjdj=bd.pjdj from
(
select nbbm,sum(((bzsl-fn)*bzdj*bzl)/((bzsl-fn)*bzl)) as pjdj from zy_yp1_sfmx where cfbj='T' group by nbbm
) as bd
left join zy_sys2_ypzdk b on bd.nbbm=b.nbbm
(
select nbbm,sum(((bzsl-fn)*bzdj*bzl)/((bzsl-fn)*bzl)) as pjdj from zy_yp1_sfmx where cfbj='T' group by nbbm
) as bd
left join zy_sys2_ypzdk b on bd.nbbm=b.nbbm