时间:2021-07-01 10:21:17 帮助过:28人阅读
BEGINFOR c IN (select distinct t2.name,t1.idfrom table1 t1,table2 t2where t1.id = t2.id)LOOPupdate table1 set name = c.name where id = c.id;END LOOP;END;
- BEGIN
- FOR c IN
- (
- select distinct t2.name,t1.id
- from table1 t1,
- table2 t2
- where t1.id = t2.id
- )
- LOOP
- update table1 set name = c.name
- where id = c.id;
- END LOOP;
- END;