Update from select - Mailing list pgsql-general

From Bret Stern
Subject Update from select
Date
Msg-id 1368476611.3693.16.camel@centos-dev.machinemanagement.com
Whole thread Raw
Responses Re: Update from select
Re: Update from select
Re: Update from select
List pgsql-general
PG 8.4

Having trouble putting together an update query to update
multiple columns in tbl1 from columns in tbl2.

update tbl1
set col3,col4,col5
from
(select col3, col4,col5 from tbl2 where col1="criteria")



Can someone add to the Postgres Docs (shown below) to help me with this.

UPDATE employees SET sales_count = sales_count + 1 WHERE id =
  (SELECT sales_person FROM accounts WHERE name = 'Acme Corporation');


Many thanks

Bret Stern



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: replanning Prepared Statements ?
Next
From: Igor Neyman
Date:
Subject: Re: Update from select