A表中有账号(ac_id) 和 积分(points)两个字段 
B表中有账号(ac_id) 和 交易金额(tx_amt) 交易日期(tx_date)三个字段 
其中积分是每交易一元钱积一分,A表中记录着每一个账号所有的积分,现在我想从A表中去掉昨天每个账号所积的分
是用
update tb1 set points = points - (select sum(tx_amt) from tb2 where tb1.ac_id = tb2.ac_id and trunc(tx_date) = trunc(sysdate-1) group by ac_id)
where exists (select 1 from tb2 where tb1.ac_id = tb2.ac_id and trunc(tx_date) = trunc(sysdate-1));
的效率高啊还是用merge into 的效率高啊?merge into a
using (select ac_id,sum(tx_amt) reducepoint from tb2 where tb1.ac_id = tb2.ac_id and trunc(tx_date) = trunc(sysdate-1) group by ac_id)) b
on(a.ac_id=b.ac_id)
when matched then
update set a.points =points - reducepoints
when not matched then
update set a.points=points -0大家帮帮我啊