Jo, Your update syntax should be UPDATE standorte SET lk = l.lk FROM landkreise as l WHERE ST_Contains(l.the_geom,standorte.the_geom) = TRUE;
Note - your below query is not using indexes. If you are using Postgis 1.2.1 or above, use the new ST_Contains instead (that will use indexes since it automagically adds the && operator) If you are using older PostGIS, then use l.the_geom && s.the_geom AND Contains(l.the_geom, s.the_geom) Hope that helps, Regina -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, July 16, 2008 6:18 AM To: postgis-users@postgis.refractions.net Subject: [postgis-users] contains syntax Hi all, I have 2 tables: 1. table "landkreise" (polygon) with column "lk" (names of administrative borders (polygons)) 2. standorte (point) with column "lk" (empty, I want to write the name of the administrative borders from the polygon-feature that contains the point) When I use following select-statement it seems to work: SELECT l.lk FROM landkreise as l, standorte as s WHERE contains(l.the_geom,s.the_geom) = TRUE; When I want to update the column "lk" in table standorte allways the same name is written: UPDATE standorte SET lk = l.lk FROM landkreise as l, standorte AS s WHERE contains(l.the_geom,s.the_geom) = TRUE; What is wrong with my syntax? Thanks Jo _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users ----------------------------------------- The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer. _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users