ITPub博客

首页 > 数据库 > Oracle > Oracle 批量更新时 Update 语句需要注意的地方

Oracle 批量更新时 Update 语句需要注意的地方

原创 Oracle 作者:guoleopard 时间:2015-04-13 16:51:06 0 删除 编辑
Oracle Update时,如果需要同时更新多个字段时,一定要严格谨慎!
例如:
Update table1 a set (c1,c2,c3)=(select c1,c2,c3 from table2 b where a.id=b.id)
where exists (select 1 from table2 where id=a.id);
要加上后面的where 条件,以保证数据能够完全匹配,从而确保数据能够正确、顺利的更新完成!

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7925783/viewspace-1572091/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2014-05-22

  • 博文量
    3
  • 访问量
    21577