with tb as
(select fx_account_id ,
cif_no ,
cif_no_type
from fx_yl_card_acct a,
fx_yl_card_cstm c,
cif_id_code_rel e
where a.fx_customer_id=c.fx_customer_id
and c.fx_crtft_number = e.id_no)
merge into fx_yl_card_trans t1
using tb t2
on (t1.fx_account_id = t2.fx_account_id)
when matched then
update set
t1.fx_cif_no=t2.cif_no ,
t1.fx_cif_no_type= t2.cif_no_type
when not matched then
insert values
(t2.fx_account_id ,t2.cif_no ,t2.cif_no_type )
------解决方案-------------------- 一楼正解 菜鸟学习中