Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
On Tue, 12 Jun 2012, David Johnston wrote: And, to be thorough, you need to put commas between each field you want to update. Did that. Didn't write it that way in the message. Regards, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your sub

Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread David Johnston
On Jun 12, 2012, at 18:50, Rich Shepard wrote: > On Wed, 13 Jun 2012, Thomas Kellerer wrote: > >> UPDATE waterchem >> SET waterchem.easting = s.easting >> waterchem.northing = s.northing >> FROM sites AS s >> WHERE waterchem.site = s.name; > > Thomas, > > For the record, running this push

Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
On Wed, 13 Jun 2012, Thomas Kellerer wrote: UPDATE waterchem SET waterchem.easting = s.easting waterchem.northing = s.northing FROM sites AS s WHERE waterchem.site = s.name; Thomas, For the record, running this pushed me to the correct syntax: UPDATE waterchem SET easting = s.e

Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
On Wed, 13 Jun 2012, Thomas Kellerer wrote: No it's not quite correct: UPDATE waterchem SET waterchem.easting = s.easting waterchem.northing = s.northing FROM sites AS s WHERE waterchem.site = s.name; Thomas, I wondered about this syntax, and doing each column separately. Thanks for

Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread Thomas Kellerer
Rich Shepard wrote on 13.06.2012 00:17: One table, waterchem, with primary key 'site' has columns easting and northing with no values in them. A second table, sites, with primary key 'name' has values for easting and northing for each row. I want to update waterchem with the easting and northi

[GENERAL] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
One table, waterchem, with primary key 'site' has columns easting and northing with no values in them. A second table, sites, with primary key 'name' has values for easting and northing for each row. I want to update waterchem with the easting and northing values from sites. My proposed statemen