zoukankan      html  css  js  c++  java
  • Oracle多表关联如何更新多个字段

    注意点:
    1、被update主表一定要加上过滤条件。
    2、查询出来更新结果集,同时也要作为被更新主表的条件,作为同步大家都是更新这部分数据。
    update student stu
      set (stu.name,stu.sex) =
      (select bak.name,bak.sex
      from student_bak bak
      where bak.id = stu.id
      and stu.age = 20
      )
      where exists (select 1
      from student_bak bak
      where bak.id = stu.id
      and stu.age = 20
      )

  • 相关阅读:
    wkhtmktopdf
    linux命令行抓取网页快照
    ubuntu 固定静态IP
    $http questions
    generate_scripts
    network
    IT_Qestion
    day03
    day02
    day01
  • 原文地址:https://www.cnblogs.com/chenweichu/p/7560489.html
Copyright © 2011-2022 走看看