Don't remember how to update a table :-( - Mailing list pgsql-general

From Constantin Teodorescu
Subject Don't remember how to update a table :-(
Date
Msg-id 361CF9C7.94439EE1@flex.ro
Whole thread Raw
List pgsql-general
I don't recall how to update a field in a table with values from another
table based on a relationship.

Table 'one' has fields 'f1','f2','f3'
Table 'two' has fields 'f1','f2','f3'

I want to update field 'f3' in table 'one' with the values of 'f3' from
table 'two' based on relationship (one.f1=two.f1) and (one.f2=two.f2)

I thought that it should work :

update one set one.f3=two.f3 from one,two where (one.f1=two.f1) and
(one.f2=two.f2);

But it doesn't work!

Am I doing something wrong ?


Please me cc: directly to teo@flex.ro
--
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA

pgsql-general by date:

Previous
From: "Jackson, DeJuan"
Date:
Subject: RE: [GENERAL] Emptying a database.
Next
From: Andy Lewis
Date:
Subject: SELECT Date