如何使用st_contains()根据其他两个表列的条件更新表列

时间:2019-02-15 21:49:59

标签: postgresql postgis

我正在尝试使用其他两个表根据st_contains()结果更新表列。我在下面编写的代码返回了太多结果。要进行这项工作,我需要更改什么?

UPDATE "PRIMARY_USE_DESC"."CAD_Primary_Desc" SET "Parcel_Desc" = 'PARK'
WHERE (
    SELECT geom_poly
    FROM "Buda_Parks" t1
    LEFT JOIN (
        SELECT geom_point 
        FROM "HCAD_POINTS"
    ) t2 ON ST_Contains(t1.geom_poly, t2.geom_point)
) IS NOT NULL

1 个答案:

答案 0 :(得分:0)

好,我知道了。如果有人有此问题,请在此处发布。

UPDATE "PRIMARY_USE_DESC"."CAD_Primary_Desc" 
Set "Parcel_Desc" = 'PARK' 
FROM
 (select geom_poly from "Buda_Parks" t1
 left join (SELECT geom_point FROM "HCAD_POINTS") t2 on ST_Contains(geom_poly,geom_point)) t3
 WHERE ST_Contains(geom_poly, geom_point)