ORACLE 兩表關聯更新

-- update
update u_db_wx.wx_epp_userid t
set t.open_id_bl =
(select t2.open_id
from u_db_wx.wx_epp_user_ext_openid t2
where t2.user_id = t.user_id_epp)
where exists (select 1
from u_db_wx.wx_epp_user_ext_openid t2
where t2.user_id = t.user_id_epp);

-- 內聯視圖更新
update
(select t.open_id_bl, t2.open_id
from u_db_wx.wx_epp_userid t,u_db_wx.wx_epp_user_ext_openid t2
where t2.user_id = t.user_id_epp) t3
set t3.open_id_bl = t3.open_id;date

相關文章
相關標籤/搜索