首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > PowerDesigner >

两表(多表)联系关系update 写法

2012-09-27 
两表(多表)关联update 写法update customers a ?? set??? city_name(select b.city_name from tmp_cust_c

两表(多表)关联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
???????????????? )

?? -- update 超过2个值
?? update customers a?
?? set??? (city_name,customer_type)=(select b.city_name,b.customer_type
???????????????????????????????????? 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
???????????????? )

热点排行