Skip site navigation (1) Skip section navigation (2)

Re: UPDATE COMPATIBILITY

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: UPDATE COMPATIBILITY
Date: 2012-01-17 08:49:44
Message-ID: jf3cl1$bap$1@dough.gmane.org (view raw or flat)
Thread:
Lists: pgsql-sql
Gera Mel Handumon, 17.01.2012 07:31:
> What version of postgresql that the update compatibility below will be
> implemented?
>
> UPDATE COMPATIBILITY
>
>
> UPDATE accounts SET (contact_last_name, contact_first_name) =
>      (SELECT last_name, first_name FROM salesmen
>       WHERE salesmen.id = accounts.sales_id);

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



In response to

Responses

pgsql-sql by date

Next:From: Filip RembiaƂkowskiDate: 2012-01-17 11:53:18
Subject: Re: Wrong query plan when using a left outer join
Previous:From: Feike SteenbergenDate: 2012-01-17 06:54:03
Subject: Wrong query plan when using a left outer join

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group