update B set b=A.b from A,B where A.a=B.ainsert into B select * from A where not exists(select 1 from B where a=A.a)