原语句

update B b
set b.fid =
(select f.id from F f where f.bid = b.id) ;

可以考虑用

begin

  for f in (select f.id,f.bid from F f) loop

    update B set b.fid=f.id where b.id=f.bid;

  end loop;

end;

这样时间可以省略跟多倍  已1000条数据为例  第一条sql语句需要 27s  第二种 只需要 0.062s ;

参考文章:http://www.yyjjssnn.cn/articles/765.html

 

相关文章:

  • 2022-12-23
  • 2021-11-30
  • 2021-09-28
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2021-06-17
  • 2022-02-11
猜你喜欢
  • 2021-11-05
  • 2022-12-23
  • 2021-10-03
  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案