当前位置: 移动技术网 > IT编程>数据库>Mysql > 解析mysql与Oracle update的区别

解析mysql与Oracle update的区别

2017年12月12日  | 移动技术网IT编程  | 我要评论

西乡县政府网,煤渣粉碎机,奇剑狂法师txt

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......;

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网