Re: Problem with self-join updates...

Поиск
Список
Период
Сортировка
От Benoit Menendez
Тема Re: Problem with self-join updates...
Дата
Msg-id 001901c1b97c$98828b60$0d01a8c0@Kestrel
обсуждение исходный текст
Ответ на Problem with self-join updates...  (Benoit Menendez <benoitm@pacbell.net>)
Список pgsql-sql
Thanks, this works... I did not know about the implicit table reference...

Now, I'm waiting for outer join updates and deletes so I don't have to use
in and sub-selects...

PostgreSQL rules...
   Benoit

----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Benoit Menendez" <benoitm@pacbell.net>
Cc: <pgsql-sql@postgresql.org>
Sent: Tuesday, February 19, 2002 11:06 AM
Subject: Re: [SQL] Problem with self-join updates...


> Benoit Menendez <benoitm@pacbell.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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html



В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem with self-join updates...
Следующее
От: "Diehl, Jeffrey"
Дата:
Сообщение: Issues w/ 7.1 to 7.2 upgrade.