两表更新这样写有优化余地吗?

yhd0411 2011-04-07 04:42:47
有两张表记录都约为200万条,进行更新操作,语句如下:
update infotemp set occurdate = '2011/04/07',bal = (select bal from tempnew a where infotemp.acno=a.acno) where exists  (select 1 from tempnew c where infotemp.acno = c.acno)


表索引是以acno为唯一字段

感觉执行了好长时间,有没有用其他方法更快一点?
...全文
44 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
kingtiy 2011-04-08
  • 打赏
  • 举报
回复

update infotemp
set occurdate = '2011/04/07',
bal =tempnew.bal
from infotemp
join tempnew
on infotemp.acno = tempnew.acno
kingtiy 2011-04-08
  • 打赏
  • 举报
回复

update infotemp
set occurdate = '2011/04/07',
bal =tempnew.bal
join tempnew
on infotemp.acno = tempnew.acno

yhd0411 2011-04-08
  • 打赏
  • 举报
回复
看来没有希望了
304的的哥 2011-04-07
  • 打赏
  • 举报
回复

update infotemp
set occurdate = to_date('2011/04/07',yyyy/mm/dd)
bal = (select bal from tempnew a where infotemp.acno=a.acno)
where exists
(select 1 from tempnew c where infotemp.acno = c.acno);

不知道,顶一下,等GS

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧