Update query by joining multiple tables. - Mailing list pgsql-sql

From Moiz Kothari
Subject Update query by joining multiple tables.
Date
Msg-id 82e1a9bd0701170320j14d4ebdagd66d8c9f095b0192@mail.gmail.com
Whole thread Raw
Responses Re: Update query by joining multiple tables.  (Andrew Sullivan <ajs@crankycanuck.ca>)
List pgsql-sql
Guys,<br /><br />on page this<br /><br /><a
href="http://www.postgresql.org/docs/8.1/interactive/sql-update.html">http://www.postgresql.org/docs/8.1/interactive/sql-update.html</a>,
itis not specified if a join can be done between multiple tables to update a table, i tried and it worked just fine for
me.Something like this : <br /><br />Infact update can work between multiple tables to... do something like :<br /><br
/>UPDATEemployees SET sales_count = a.sales_count FROM accounts as a<br />  WHERE <a href="http://a.name">a.name</a> =
'AcmeCorporation' <br />  AND <a href="http://employees.id">employees.id</a> = a.sales_person;<br /><br />considering
sales_countas a column in accounts table.<br /><br />Regards,<br />Moiz<br /><br /><br /> 

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Removing CONTEXT message
Next
From: Marcin Stępnicki
Date:
Subject: Postgresql & Oracle Heteregenous services - strange behaviour