天天看點

循環更新資料庫 腳本

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;