首頁  >  文章  >  資料庫  >  解析mysql与Oracle update的区别_MySQL

解析mysql与Oracle update的区别_MySQL

WBOY
WBOY原創
2016-06-01 13:25:14919瀏覽

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

bitsCN.com

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn