17,078
社区成员
发帖
与我相关
我的任务
分享
Merge into STG
Using (
select * from ERP
where creation_date >= last pull time
) erp_t
on (
STG.C1 = erp_t.C1
AND STC.C2 = erp_t.C2
)
when NOT MATCHED THEN
INSERT (C1,C2) VALUES (erp_t.C1, erp_t.C2)
when MATCHED THEN
NULL;
insert into stg(id,c1,c2,c3,c4……)
select id,c1,c2,c3,c4……
from erp
where not exist (select 1 from stg where id=erp.id)