- SQL code
merge into FX_AGENCY L using FX_AGENCY N on (N.AGENCYID=2) WHEN MATCHED THEN UPDATE set AGENCYID=1 WHEN NOT MATCHED THEN INSERT (AGENCYID,AGENCYNAME) values (1,'1')
上面报错
使用merge into能不能达到 当存在更新 不存在插入
------解决方案--------------------
when matched then 后边不能再insert 改成update语句
select 2 AGENCYID from dual 把2加上引号 select '2' AGENCYID from dual
------解决方案--------------------