1.使用Update命令
UPDATE A SET A.name = (SELECT B.name FROM B WHERE A.id= B.id)
WHERE EXISTS (SELECT 1 FROM B WHERE B.id= A.id)
2.使用MERGE语句
Merge into A a using B b on (a.id = b.id)
when matched then update set a.name = b.name
UPDATE A SET A.name = (SELECT B.name FROM B WHERE A.id= B.id)
WHERE EXISTS (SELECT 1 FROM B WHERE B.id= A.id)
Merge into A a using B b on (a.id = b.id)
when matched then update set a.name = b.name