orcle 多表關聯update

ORACLE UPDATE 多表關聯的update語句

  -- update 超過2個值
   update customers a   -- 使用別名
   set    (city_name,customer_type)=(select b.city_name,b.customer_type 
                                     from   tmp_cust_city b 
                                     where  b.customer_id=a.customer_id)
   where  exists (select 1 
                  from   tmp_cust_city b
                  where  b.customer_id=a.customer_id
                 )

 

update mafedb.t_cqcs_batchinfo a set a.trandate=(select trandate from mafedb.t_cqcs_qryctlreq b where a.batchno=b.batchno and rownum=1 ) where a.trandate<=20180920
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章