计算sql
select
tb_h195z_ID,
Round(tb_h195z_m408e * tb_h195z_c6u/(tb_h195z_s621k * tb_h195z_m408e/b.z),2) ,
tb_h195z_q554i
from tb_h195z a
left join (select sum(tb_h195z_m408e) as z,tb_h195z_num2 from tb_h195z group by tb_h195z_num2) as b on a.tb_h195z_num2= b.tb_h195z_num2
where tb_h195z_ID in (1447,1448,1449,1450,1451,1452,1453,1454,1455)
update tb_h195z set tb_h195z_c6u=‘44.1’ where tb_h195z_ID = 1455
连表update sql:
update tb_h195z set tb_h195z.tb_h195z_q554i=b.z
from (select tb_h195z_ID,
Round(tb_h195z_m408e * tb_h195z_c6u/(tb_h195z_s621k * tb_h195z_m408e/b.z),2) z
from tb_h195z a
left join (select sum(tb_h195z_m408e) as z,tb_h195z_num2 from tb_h195z group by tb_h195z_num2) as b on a.tb_h195z_num2= b.tb_h195z_num2
where tb_h195z_ID in (1447,1448,1449,1450,1451,1452,1453,1454,1455))b
inner join tb_h195z on tb_h195z.tb_h195z_ID =b.tb_h195z_ID
where tb_h195z.tb_h195z_ID in (1447,1448,1449,1450,1451,1452,1453,1454,1455)