Re: UPDATE of several columns using SELECT statement - Mailing list pgsql-general

From Richard Huxton
Subject Re: UPDATE of several columns using SELECT statement
Date
Msg-id 49BFC1F3.8040006@archonet.com
Whole thread Raw
In response to UPDATE of several columns using SELECT statement  ("adam.slachta" <adam.slachta@xitee.com>)
List pgsql-general
adam.slachta wrote:
>
> 1. When trying to update two columns
>
> UPDATE myFirstTable SET (fistCol, secCol) = (  SELECT anotherFistCol,
> anotherSecondCol FROM mySecondTable )

In addition to Sam's reply what you've got there would never work anyway
unless mySecondTable only contains one row. You'd need a join. Like Sam
says though, we don't support that syntax.

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: Ivano Luberti
Date:
Subject: Re: COPY command question
Next
From: Raymond O'Donnell
Date:
Subject: Re: COPY command question