Search Postgresql Archives

UPDATE Syntax Check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  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
statement is,

  UPDATE waterchem
  SET waterchem.easting, waterchem.northing = sites.easting, sites.northing
  FROM sites AS s
  WHERE waterchem.site = s.name;

  Is this correct? If not, what approach should I adopt?

Rich



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux