--合并两张表的内容
merge into new_table using old_table on (new_table.id = old_table.id)
when matched then
  update newtable ....
  when not matched then
  insert new_table ...

类似触发器

相关文章: