Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 92B861DA4C1E for ; Tue, 17 Jan 2012 11:20:08 -0400 (AST) Received: from mail-iy0-f174.google.com ([209.85.210.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RnApQ-0005ab-CQ for pgsql-sql@postgresql.org; Tue, 17 Jan 2012 15:20:08 +0000 Received: by iagf6 with SMTP id f6so4388227iag.19 for ; Tue, 17 Jan 2012 07:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=D6JYiDRa/wmLyoUHtyOC81FC20HcG2hLR03F5uCBksU=; b=ry+NEWvv2oa9BVVIqJ4XLQSsA+9xFxaZiRD5MsH1AFbWqTaKCkt1t3jy93+6H7ywwt b8EV22IhI46Un2602Lsxk3f1ifAVltcjAOgQ3u7AgpFzfvClwKHfRupygEbpnPCQ6xoY 9bESg78xIFqtlPifax4CQmn9+1PPPqYjiLI2w= Received: by 10.42.19.69 with SMTP id a5mr12354299icb.35.1326813591902; Tue, 17 Jan 2012 07:19:51 -0800 (PST) Received: from tucker.localnet (c-24-17-164-54.hsd1.wa.comcast.net. [24.17.164.54]) by mx.google.com with ESMTPS id z22sm78295752ibg.5.2012.01.17.07.19.50 (version=SSLv3 cipher=OTHER); Tue, 17 Jan 2012 07:19:50 -0800 (PST) From: Adrian Klaver To: pgsql-sql@postgresql.org Subject: Re: UPDATE COMPATIBILITY Date: Tue, 17 Jan 2012 07:19:47 -0800 User-Agent: KMail/1.13.5 (Linux/2.6.32-37-generic; KDE/4.4.5; i686; ; ) Cc: Thomas Kellerer References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201170719.47830.adrian.klaver@gmail.com> X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201201/75 X-Sequence-Number: 36246 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