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 )

 

上一篇:java – 尝试传递自定义oracle类型对象映射时无效的名称模式


下一篇:《Oracle PLSQL从入门到精通》pdf电子版