From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Re: UPDATE COMPATIBILITY
Date: Tue, 17 Jan 2012 17:28:40 +0100
Message-ID: <jf47hg$mus$1@dough.gmane.org> (raw)
In-Reply-To: <201201170719.47830.adrian.klaver@gmail.com>
References: <CAOeONq5n2B8VNTghx1=_=zOjNbVRff4YE=kVngGfL2etrg79Pw@mail.gmail.com>
<jf3cl1$bap$1@dough.gmane.org>
<201201170719.47830.adrian.klaver@gmail.com>
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!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: spam_eater@gmx.net
Subject: Re: UPDATE COMPATIBILITY
In-Reply-To: <jf47hg$mus$1@dough.gmane.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox