得用rowid更新表内容

begin
for cc in ( select t.yskid , t.xuh, row_number() OVER(PARTITION BY t.yskid order by t.yssjid ) as row_flg ,rowid from yuansbxsj t ) loop

update yuansbxsj xx set xx.xuh = cc.row_flg where xx.rowid = cc.rowid;

end loop ;

end;

原文地址:https://www.cnblogs.com/maweiwei/p/14700941.html