Code :
MERGE INTO t1 -- main table USING t2 -- prepare table ON (t1.id= t2.id) -- condition by key WHEN MATCHED THEN UPDATE SET t1.name= t2.name WHEN NOT MATCHED THEN INSERT -- column main table (t1.id, t1.name, t1.email) VALUES -- value from prepare table (t2.id, t2.name, t2.email); |
No comments:
Post a Comment