天天看点

循环更新数据库 脚本

declare i number(4);

begin

i:=1;

while( i<100)

 loop

update pms_node n set n.brandcount=(select count(*) from pms_brand b where b.nodeid=i) where n.id=i;

 i:=i+1;

end loop;

end;