Search Postgresql Archives

Update from select

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux