D
dez_0609
Unregistered / Unconfirmed
GUEST, unregistred user!
update 表3 set 合计金额=b.合计金额
from
(
select 流水号,sum(金额) as 合计金额 from
(select 流水号,金额 from 表1
union all
select 流水号,金额 from 表2 ) as a
group by 流水号
) as b
where 表3.流水号=b.流水号
from
(
select 流水号,sum(金额) as 合计金额 from
(select 流水号,金额 from 表1
union all
select 流水号,金额 from 表2 ) as a
group by 流水号
) as b
where 表3.流水号=b.流水号