Re: Problem with self-join updates...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem with self-join updates...
Дата
Msg-id 6776.1014145606@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problem with self-join updates...  (Benoit Menendez <benoitm@pacbell.net>)
Список pgsql-sql
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


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

Предыдущее
От: Benoit Menendez
Дата:
Сообщение: Problem with self-join updates...
Следующее
От: Benoit Menendez
Дата:
Сообщение: Re: Problem with self-join updates...