Hi all,<br><br>Thanks, understand.<br><br>Ok, is there another way to update poi's province.ogc_fid with the bounding province's ogc_fid ???<br>Namely i want to learn the province of POI's...<br><br>Regards..<br>
<br><br><div class="gmail_quote">On Tue, Jan 26, 2010 at 2:20 PM, Rafael Soto <span dir="ltr"><<a href="mailto:rafael.soto@gmail.com">rafael.soto@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello my friend..<br><br>Your query is not wrong but your record true..<br><br>When you call a subselect to complete your UPDATE operation, this subselect can be only one row in result return.<br>To correct this, you must be define one filter to decide what the result you want to UPDATE.<br>
To see the mistake, execute a subselect {{{ select<b> province.ogc_fid from province,poi where intersects(poi.the_geom, province.the_geom)=True group by province.ogc_fid</b> }} and check the number of rows in the resultset.<br>
<br><br><br><br><div class="gmail_quote"><div><div></div><div class="h5">On Tue, Jan 26, 2010 at 9:57 AM, ibrahim saricicek <span dir="ltr"><<a href="mailto:ibrahimsaricicek@gmail.com" target="_blank">ibrahimsaricicek@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
<br><br><div class="gmail_quote">Hi all,<br><br>I have two tables; provinces an points of interests. I wanna update province_id column with st_intersects function..<div><br><br>My sql;<br><br>update poi set province_id=(<br>
</div>select province.ogc_fid from province,poi where intersects(poi.the_geom, province.the_geom)=True group by province.ogc_fid<br>
)<br><br></div>The message is <br>
<br>
ERROR: more than one row returned by a subquery used as an expression<br>
<br>
What should I change?
<br></div></div>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><font color="#888888">Rafael Soto<br><br>
</font><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br>