时间:2021-07-01 10:21:17 帮助过:30人阅读
- update table A a<br>set a.c1 = (select b.c1 from B b where a.id = b.id)<br>where exists(select 1 from B b where a.id = b.id )
可以考虑使用以下方式来更新表中的数据避免对B的两次查询
- <span style="color: #0000ff">update</span> (<span style="color: #0000ff">select</span> a.c1 a_c1, b.c1 b_c1 <span style="color: #0000ff">from</span> A a, B <span style="color: #0000ff">where</span> a.id <span style="color: #808080">=</span><span style="color: #000000"> b.id)
- </span><span style="color: #0000ff">set</span> a_c1 <span style="color: #808080">=</span> b_c1
oracle笔记--DML语句优化
标签:table where 默认 删除 end logs io子系统 避免 run