1. 取A表的数据,更新B表字段
update m_build b
set b.district_id=(
select d.district_id
from
bjhouse.d_district d
where
b.build_name_jq=d.district_name)
where exists
(select 1
from
bjhouse.d_district d
where
b.build_name_jq=d.district_name)
本文介绍了一种批量操作技术,用于更新数据库表中的字段,通过查询另一个表获取对应地理区域ID,实现数据的高效同步和地域关联。
1. 取A表的数据,更新B表字段
update m_build b
set b.district_id=(
select d.district_id
from
bjhouse.d_district d
where
b.build_name_jq=d.district_name)
where exists
(select 1
from
bjhouse.d_district d
where
b.build_name_jq=d.district_name)
4568

被折叠的 条评论
为什么被折叠?