Re: Problem with self-join updates...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Benoit Menendez <benoitm(at)pacbell(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Problem with self-join updates...
Date: 2002-02-19 19:06:46
Message-ID: 6776.1014145606@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Benoit Menendez <benoitm(at)pacbell(dot)net> writes:
> I have the following self-join update:

> update TABLE set PARENT_ID=parent.PARENT_ID
> from TABLE, TABLE parent
> where TABLE.PARENT_ID=parent.ID
> and parent.ID in (1,2,3,4)

> Table name "table" specified more than once

Wasn't this answered already? You should not have the "from TABLE"
in there. Essentially, there's already an implicit FROM entry for
the target table, you don't need another. "from TABLE parent"
is sufficient here.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Benoit Menendez 2002-02-19 19:35:32 Re: Problem with self-join updates...
Previous Message Andy Marden 2002-02-19 18:41:23 Dates and year 2000