plsql多表聯查update


 1 update customers a -- 使用別名
 2 set city_name=(select b.city_name from tmp_cust_city b where b.customer_id=a.customer_id)
 3 where exists (select 1
 4 from tmp_cust_city b
 5 where b.customer_id=a.customer_id
 6 )
 7 -- update 超過2個值
 8 update customers a -- 使用別名
 9 set (city_name,customer_type)=(select b.city_name,b.customer_type
10 from tmp_cust_city b
11 where b.customer_id=a.customer_id)
12 where exists (select 1
13 from tmp_cust_city b
14 where b.customer_id=a.customer_id
15 )

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM