Re: Update Join ?

From: "Adam Rich" <adam(dot)r(at)sbcglobal(dot)net>
To: "'kevin kempter'" <kevin(at)kevinkempterllc(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Update Join ?
Date: 2008-04-01 21:55:28
Message-ID: 090001c89443$1a128480$4e378d80$@r@sbcglobal.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> Does Postgres allow updates based on the context of a sub-query,
something like the sample below ?

Yes,

Update real_tab
set real_tab.data_desc = temp_tab.data_desc
>From temp_tab
Where real_tab.keyID = temp_tab.keyID

(don't repeat your updated table in the "from" list unless you
Mean to self-join)

http://www.postgresql.org/docs/8.3/interactive/sql-update.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message carty mc 2008-04-01 22:28:19 dblink ,dblink_exec not participating in a Transaction??
Previous Message kevin kempter 2008-04-01 21:51:30 Update Join ?