【Oracle】Update方法

1、单表更新

  update customers 

  set city_name='山西省太原市'

  where city_name='山西太原'

2、两表(多表)关联update -- 被修改值由另一个表运算而来

  update customers a

  set city_name=(select b.city_name 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)

 

posted @ 2016-06-25 11:45  卡卡不卡  阅读(644)  评论(0编辑  收藏  举报