Re: UPDATE COMPATIBILITY

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Cc: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Subject: Re: UPDATE COMPATIBILITY
Date: 2012-01-17 15:19:47
Message-ID: 201201170719.47830.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Thomas Kellerer 2012-01-17 16:28:40 Re: UPDATE COMPATIBILITY
Previous Message David Johnston 2012-01-17 14:05:44 Re: sql query problem