[postgis-users] update an st_intersects

Rafael Soto rafael.soto at gmail.com
Tue Jan 26 04:20:38 PST 2010


Hello my friend..

Your query is not wrong but your record true..

When you call a subselect to complete your UPDATE operation, this subselect
can be only one row in result return.
To correct this, you must be define one filter to decide what the result you
want to UPDATE.
To see the mistake, execute a subselect {{{ select*  province.ogc_fid from
province,poi where intersects(poi.the_geom, province.the_geom)=True group by
province.ogc_fid* }} and check the number of rows in the resultset.




On Tue, Jan 26, 2010 at 9:57 AM, ibrahim saricicek <
ibrahimsaricicek at gmail.com> wrote:

>
>
> Hi all,
>
> I have two tables; provinces an points of interests. I wanna update
> province_id column with st_intersects function..
>
>
> My sql;
>
> update poi set province_id=(
> select province.ogc_fid from province,poi where intersects(poi.the_geom,
> province.the_geom)=True group by province.ogc_fid
> )
>
> The message is
>
> ERROR: more than one row returned by a subquery used as an expression
>
> What should I change?
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>


-- 
Rafael Soto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100126/aea6d0a2/attachment.html>


More information about the postgis-users mailing list