Re: It is possible to update more than 1 table in the same update statement? - Mailing list pgsql-general

From Andre Lopes
Subject Re: It is possible to update more than 1 table in the same update statement?
Date
Msg-id AANLkTi=1mCZix50cyKn-jGFbB1hW5YdgmfNBNMJJdd-W@mail.gmail.com
Whole thread Raw
In response to Re: It is possible to update more than 1 table in the same update statement?  (Scott Ribe <scott_ribe@killerbytes.com>)
Responses Re: It is possible to update more than 1 table in the same update statement?  (Scott Ribe <scott_ribe@killerbytes.com>)
Re: It is possible to update more than 1 table in the same update statement?  (Szymon Guz <mabewlun@gmail.com>)
List pgsql-general
Sorry for not explain well.

I mean update more than one table at the same time with something like this:

update table1, table2
set
table1.f1 = 'aaa',
table2.date = '2001-01-01'
where
table1.id = 'x1' and table2.id = 'x1'

Something like this is possible? It is the best way to do it?

Best Regards,


On Sun, Nov 7, 2010 at 3:11 PM, Scott Ribe <scott_ribe@killerbytes.com> wrote:
On Nov 7, 2010, at 7:58 AM, Andre Lopes wrote:

>  need to update various tables in the same update. It is possible to do it?

Transactions???

--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





pgsql-general by date:

Previous
From: Scott Ribe
Date:
Subject: Re: It is possible to update more than 1 table in the same update statement?
Next
From: Scott Ribe
Date:
Subject: Re: It is possible to update more than 1 table in the same update statement?