不使用游标,多张表的多条记录更新
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;
http://www.htsjk.com/shujukunews/884.html
www.htsjk.Com
true
http://www.htsjk.com/shujukunews/884.html
NewsArticle
不使用游标,多张表的多条记录更新 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;...
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。