Re: Table name specified more than once

Поиск
Список
Период
Сортировка
От Manfred Koizar
Тема Re: Table name specified more than once
Дата
Msg-id fotjevcvhljovir89cnl5mbga5mhr41uir@4ax.com
обсуждение исходный текст
Ответ на Table name specified more than once  (Alexander Mueller <Alexander.Mueller@SurfControl.com>)
Список pgsql-general
On Fri, 13 Jun 2003 17:07:28 +0200, Alexander Mueller
<Alexander.Mueller@SurfControl.com> wrote:
>It results in a "Table name "Workstations" specified more than once" error
>message. Can anyone help me with correcting the syntax?

Don't include the table you want to update in the FROM list:

    UPDATE onetable
       SET col1 = othertable.cola, col2 = othertable.colb
      FROM othertable
     WHERE onetable.x = othertable.y;

In your case othertable is the subselect and the JOIN condition moves
to the WHERE clause.

>copying, distribution or any action taken or omitted to  be taken in
>reliance on it, is prohibited and may be unlawful.

Am I going to be arrested? :-(

Servus
 Manfred

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