[postgis-users] More newbie' questions
Tim Robertson
trobertson at gbif.org
Tue Apr 10 03:04:05 PDT 2007
Ok
sorry didnt realize postgres didnt support that SQL
Try:
update b, p set b.areaB = p.areaP where p.numerodist=b.numerodist and and
p.numerosecc=b.numerosecc
kind of thing
not really sure what you are trying to do, but inner select
seems strange
_____
From: Tim Robertson [mailto:trobertson at gbif.org]
Sent: Tuesday, April 10, 2007 10:24 AM
To: 'PostGIS Users Discussion'
Subject: RE: [postgis-users] More newbie' questions
Hi
Perhaps something like this might help?
update b inner join p on p.numerodist=b.numerodist and and
p.numerosecc=b.numerosecc set b.areaB = p.areaP
?
_____
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Gustavo
Ces
Sent: Tuesday, April 10, 2007 10:21 AM
To: PostGIS Users Discussion
Subject: [postgis-users] More newbie' questions
Hi all,
I´m trying to insert a column data ( double precision) from table p into
another column b with two common columns( numerodist and numerosecc):
update b set areaB=(select p.areaP from p, b where
p.numerodist=b.numerodist
and p.numerosecc=b.numerosecc);
but this way i can´t because the result is a lot of rows, not a single one.
How can i update my p table with the value of just one row of the first one?
I know this is a sql question but i read the postgres reference and don´t
know how to solve this.
Thanks in advance,
Galois
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070410/cf72e7c1/attachment.html>
More information about the postgis-users
mailing list