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