我正在尝试使用选择查询更新一个表中的列。
它运行并将整个 type_
列更新为 religious
(文本字段)。
我试图只更新宗教几何图形与宗地几何图形相交的行。
update wash_parcels_final
set type_ = t.religious
from (select wash_worship.religious
from wash_parcels_final
join wash_worship
on st_intersects(wash_worship.geom, wash_parcels_final.geom)) t
最佳答案
我想这就是你想要的:
update wash_parcels_final
set type_ = ww.religious
from wash_worship ww
where st_intersects(ww.geom, wash_parcels_final.geom);
关于sql - postgresql 更新列从选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44345875/