UPDATE with value from another table

From: "Thomas T(dot) Thai" <tom(at)minnesota(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: UPDATE with value from another table
Date: 2002-03-02 05:08:08
Message-ID: Pine.NEB.4.43.0203012304270.28289-100000@ns01.minnesota.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

UPDATE [ ONLY ] table SET col = expression [, ...]
[ FROM fromlist ]
[ WHERE condition ]

Is this valid:

UPDATE table1
SET col = table2.col
FROM table2
WHERE col = table2.id;

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2002-03-02 06:20:49 Re: UPDATE with value from another table
Previous Message Jeff Davis 2002-03-02 01:34:17 Re: PostgreSQl or BerkeleyDB ??