merge语法:
merge INTO table_name
USING (table|view|sub_query)
ON (join condition)
WHEN MATCHED THEN
UPDATE SET
col1 = col_val1,
col2 = col2_val
WHEN NOT MATCHED THEN
INSERT (column_list) VALUES (column_values);
--------------------------------------------------------------------------------
merge problem
merge into table2
using table1
on (table2.colname1=table1.colname1)
when matched then
update set table2.colname2=table1.colname1||','||table1.colname2
when not matched then
insert (colname1,colname2) value (table1.colname1.table1.colname2);
合并完毕数据,最后不要忘记commit