1、Merge into
MERGE [INTO [schema .] table [t_alias]
USING [schema .] { table | view | subquery } [t_alias]
ON ( condition )
WHEN MATCHED THEN merge_update_clause
WHEN NOT MATCHED THEN merge_insert_clause
merge into 表
using {表,子查询结果集}
on (条件)
when matched then(匹配)
update set users.user_name = doctor.doctorname
when not matched then(不匹配)
insert values('值1','值2',....)
merge into users
using man
on (users.user_id = man.man_id)
when matched then
update set users.user_name = man.man_name
when not matched then
insert values (man.man_id,man.man_name,'年龄',sysdate);