Re: UPDATE .. JOIN? - Mailing list pgsql-general

From Sergei Shelukhin
Subject Re: UPDATE .. JOIN?
Date
Msg-id 478992F2.6080302@gmail.com
Whole thread Raw
In response to Re: UPDATE .. JOIN?  ("Rodrigo E. De León Plicet" <rdeleonp@gmail.com>)
Responses Re: UPDATE .. JOIN?  ("Rodrigo E. De León Plicet" <rdeleonp@gmail.com>)
List pgsql-general
Rodrigo E. De León Plicet wrote:
> On Jan 12, 2008 5:22 PM, Sergei Shelukhin <realgeek@gmail.com> wrote:
>
>> Hi.
>>
>> I was wondering if I could do something similar to this in Postgres and
>> if yes how?
>>
>> UPDATE table1 SET blah = 1 FROM table1
>>     INNER JOIN table2 ON table1.id = table2.t1id
>>
>
> UPDATE table1 t1
> SET blah = 1
> FROM table2 t2
> WHERE t1.id = t2.t1id
>
>
Hmmm. What if there's more than one table? Is "from x,y" a viable option?


pgsql-general by date:

Previous
From: "Rodrigo E. De León Plicet"
Date:
Subject: Re: UPDATE .. JOIN?
Next
From: "Gurjeet Singh"
Date:
Subject: ERROR during WAL replay