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)

 

-----------------------------------------------------------------Take more responsibility!---------------------------------------------------------