create table t1(
id number(10),
name varchar2(10)
);
create table t2(
id number(10),
name varchar2(10)
);
insert into t1 values(1,‘06‘);
insert into t1 values(2,‘02‘);
insert into t2 values(3,‘03‘);
insert into t2 values(1,‘01‘);
select * from t1;
select * from t2;
update t1
set t1.name = (select t2.name from t2 where t2.id=t1.id)
where exists (select * from t2 where t2.id=t1.id) ;
原文:https://www.cnblogs.com/szl6/p/9509537.html