Re: UPDATE COMPATIBILITY - Mailing list pgsql-sql

From Thomas Kellerer
Subject Re: UPDATE COMPATIBILITY
Date
Msg-id jf47hg$mus$1@dough.gmane.org
Whole thread Raw
In response to Re: UPDATE COMPATIBILITY  (Adrian Klaver <adrian.klaver@gmail.com>)
List pgsql-sql
Adrian Klaver, 17.01.2012 16:19:
>> You need to rewrite it to:
>>
>> UPDATE accounts
>>     SET contact_last_name = s.last_name,
>>         contact_first_name = s.first_name
>> FROM salesmen s
>> WHERE s.id = accounts.sales_id
>
> For completeness, you could also do:
>
>   UPDATE accounts
>      SET (contact_last_name,contact_first_name)=
>     (s.last_name,s.first_name)
>   FROM salesmen s
>   WHERE s.id = accounts.sales_id
>

Nice one!




pgsql-sql by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: UPDATE COMPATIBILITY
Next
From: Feike Steenbergen
Date:
Subject: Re: Wrong query plan when using a left outer join