ITPub博客

首页 > IT职业 > IT图书 > 解析mysql与Oracle update的区别

解析mysql与Oracle update的区别

IT图书 作者:limiao 时间:2021-09-09 09:30:37 0 删除 编辑

           update :单表的更新不用说了,两者一样,主要说说多表的更新
复制代码 代码如下:      
Oracle> Oracle的多表更新要求比较严格,所以有的时候不是很好写,我们可以试试Oracle的游标
        update (
        select t.charger_id_ new_charger_id_
        from t_cus_year_status t
        left join t_customer_infos cus on cus.id_ = t.cus_id_
        where....
        ) n  set  n.new_charger_id_ =6;


复制代码 代码如下:
mysql>
      update t_cus_year_status t
      left join t_customer_infos cus on cus.id_ = t.cus_id_
      set t.charger_id_  =6
      where......;

                       

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

请登录后发表评论 登录
全部评论

注册时间:2019-07-10

  • 博文量
    190
  • 访问量
    1372