From: Tom Lane <tgl@sss.pgh.pa.us>
To: Barry Lind <barry@xythos.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Something I'd like to try...
Date: Tue, 03 Oct 2000 15:03:41 -0400
Message-ID: <29636.970599821@sss.pgh.pa.us> (raw)
In-Reply-To: <39DA19AA.9C87067A@xythos.com>
References: <200010030322.XAA05358@candle.pha.pa.us>
<16699.970547357@sss.pgh.pa.us>
<39DA19AA.9C87067A@xythos.com>
Barry Lind <barry@xythos.com> writes:
> I have a table that stores a hierarchy. Sometimes in an update I want
> to join back to the same table to get other information related to
> children or parent rows. In Oracle I can do this using the alias, but
> in Postgresql I cannot.
> update table_foo f1
> set column_b = 1
> where exists (select column_a from table_foo f2
> where f2.parent_foo_id = f1.foo_id);
What's wrong with the spec-compliant
update table_foo
set column_b = 1
where exists (select column_a from table_foo f2
where f2.parent_foo_id = table_foo.foo_id);
?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, barry@xythos.com
Subject: Re: Something I'd like to try...
In-Reply-To: <29636.970599821@sss.pgh.pa.us>
References: <200010030322.XAA05358@candle.pha.pa.us> <16699.970547357@sss.pgh.pa.us> <39DA19AA.9C87067A@xythos.com> <29636.970599821@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox