SQL命令未正确结束,求大神指点一二!
发布网友
发布时间:2024-10-10 00:02
我来回答
共2个回答
热心网友
时间:2024-11-19 01:33
两表(多表)关联update -- 被修改值由另一个表运算而来
oracle SQL 代码
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
)
热心网友
时间:2024-11-19 01:33
update sm_ch_jqdj_tb t1
set jqdj = temp_jqdj_tb.jqdj
from temp_jqdj_tb t2
where t1.ckid || t1.wlid = t2.ckid || t2.wlid