日期:2014-05-17 浏览次数:21069 次
MERGE INTO B USING ( SELECT ID,COL_1,COL_2... FROM A WHERE A.IMPORTDIRECTION=1 )A ON (B.ID=A.ID) WHEN MATCHED THEN UPDATE SET B.COL_1=A.COL_1, B.COL_2=A.COL_2, ... WHEN NOT MATCHED THEN INSERT (ID,COL_1,COL_2...) VALUE(A.ID,A.COL_2,...); UPDATE A SET IMPORTDIRECTION=4;