Re: UPDATE .. JOIN?

From: Rodrigo E(dot) De León Plicet <rdeleonp(at)gmail(dot)com>
To: "Sergei Shelukhin" <realgeek(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: UPDATE .. JOIN?
Date: 2008-01-13 05:10:15
Message-ID: a55915760801122110j61e82e13j4475695870ccc947@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jan 13, 2008 12:05 AM, I said
> It's all in the docs:
> http://www.postgresql.org/docs/8.2/static/sql-update.html

To clarify, you can use the direct form, without using a subselect:

UPDATE table1 t1
SET blah = 1
FROM table2 t2
JOIN table3 t3
ON t2.id = t3.t2id
WHERE t1.id = t2.t1id

Lookup "fromlist" (without the quotes) on the quoted link.

Regards.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2008-01-13 05:59:22 Re: 8.2.4 serious slowdown
Previous Message Rodrigo E. De León Plicet 2008-01-13 05:05:00 Re: UPDATE .. JOIN?