Re: getting rid of "Adding missing FROM-clause entry...."

Поиск
Список
Период
Сортировка
От Manfred Koizar
Тема Re: getting rid of "Adding missing FROM-clause entry...."
Дата
Msg-id 6ijt9vgiapkddv4o7cvj9rjprbmdkkcd8b@4ax.com
обсуждение исходный текст
Ответ на Re: getting rid of "Adding missing FROM-clause entry...."  (Rajesh Kumar Mallah <mallah@trade-india.com>)
Список pgsql-sql
On Thu, 17 Apr 2003 21:22:17 +0530, Rajesh Kumar Mallah
<mallah@trade-india.com> wrote:
>BTW any idea why the query which i posted is not
>working? and issuing a NOTICE.

I guess, in 
UPDATE t1   SET ...  FROM (SELECT ... FROM t2        WHERE t2.id = t1.id);

the subselect is not correlated because t1 and the subquery are on the
same level.  So the subquery is treated like a standalone query and as
it does not have t1 in its FROM clause, t1 is added automatically.
Then the result of the subquery is joined to each row of t1 for the
update.  This also explains why all rows were updated to the same
values.

ServusManfred



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

Предыдущее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: getting rid of "Adding missing FROM-clause entry...."
Следующее
От: Tom Lane
Дата:
Сообщение: Re: analyse question..