[postgis-users] Update field from expression

Birgit Laggner birgit.laggner at vti.bund.de
Fri Jan 28 05:43:11 PST 2011


  No, probably not :-) - I was just fixed on the sub-select solution 
which is unnecessarily complicated...

On 28.01.2011 14:10, Ture Pålsson wrote:
> 2011/1/28 Birgit Laggner<birgit.laggner at vti.bund.de>:
>> UPDATE permit_sites p_s SET huc = giddy.h_gid FROM (SELECT p.gid p_gid,
>> h.gid h_gid FROM permit_sites p inner join huc8 h on p.the_geom @ h.the_geom
>>   WHERE ST_Within(p.the_geom,h.the_geom)) AS giddy WHERE p_s.gid=giddy.p_gid;
> Is there something wrong with simply doing
>
> UPDATE permit_sites p
> SET huc = h.gid
> FROM huc8 h
> WHERE ST_Within(p.the_geom, h.the_geom)
>
> ?
>
> (Assuming that is what the OP wanted to do, of course...)
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list