--批量對符合條件的表記錄進行更新 --aa代表查詢出的符合條件數據的別名 --aa后的表示需要符合的條件 --loop后開始寫更新操作 begin for aa in (select a.objectid from geographic_info a, geographic_info_bf b where a.objectid = b.objectid and b.pgeocode = 'xxx') loop update geographic_info set qxcode = 'xxx', pgeocode = 'xxx' where objectid = aa.objectid; end loop; end;
