Re: BUG #5898: Nested "in" clauses hide bad column names

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: BUG #5898: Nested "in" clauses hide bad column names
Дата
Msg-id
3314.1298396703@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
BUG #5898: Nested "in" clauses hide bad column names "Scott Dunbar" <scott@xigole.com>
Re: BUG #5898: Nested "in" clauses hide bad column names Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #5898: Nested "in" clauses hide bad column names Scott Dunbar <scott@xigole.com>
Re: BUG #5898: Nested "in" clauses hide bad column names "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: BUG #5898: Nested "in" clauses hide bad column names Eric Schwarzenbach <subscriber@blackbrook.org>
"Scott Dunbar"  writes:
> I have a nested in clause like:

> select respondent_id from respondent where respondent_id in (select
> respondent_id from chat_session where project_id in (select project_id from
> project where company_id = 4));

> However, in this example, there is no column named respondent_id in the
> chat_session table.

Probably there is one in respondent, though?  This behavior is not a bug
--- what you have there is an outer reference, and it is working exactly
as specified by the SQL standard.  Sub-selects would be a whole lot less
useful if they couldn't refer to variables of the outer query.

			regards, tom lane
В списке pgsql-bugs по дате отправления
От: Scott Dunbar
Дата:
От: Scott Dunbar
Дата:
FAQ