From: Adrian Klaver <adrian.klaver@gmail.com>
To: pgsql-sql@postgresql.org
Cc: Thomas Kellerer <spam_eater@gmx.net>
Subject: Re: UPDATE COMPATIBILITY
Date: Tue, 17 Jan 2012 07:19:47 -0800
Message-ID: <201201170719.47830.adrian.klaver@gmail.com> (raw)
In-Reply-To: <jf3cl1$bap$1@dough.gmane.org>
References: <CAOeONq5n2B8VNTghx1=_=zOjNbVRff4YE=kVngGfL2etrg79Pw@mail.gmail.com>
<jf3cl1$bap$1@dough.gmane.org>
On Tuesday, January 17, 2012 12:49:44 am Thomas Kellerer wrote:
> Gera Mel Handumon, 17.01.2012 07:31:
>
> None as far as I know.
>
> 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
Gets you a little closer to what you want:)
--
Adrian Klaver
adrian.klaver@gmail.com
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: adrian.klaver@gmail.com, spam_eater@gmx.net
Subject: Re: UPDATE COMPATIBILITY
In-Reply-To: <201201170719.47830.adrian.klaver@gmail.com>
* 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