Re: Subqueries

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Subqueries
Дата
Msg-id 87hc6tghen.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Subqueries  ("Pascal Tufenkji" <ptufenkji@usj.edu.lb>)
Список pgsql-sql
"Pascal Tufenkji" <ptufenkji@usj.edu.lb> writes:

> I understand the fact that "the inner query is executed before the outer
> query and the inner query doesn't even know about the outer query."
>
> But why the following query can be executed, although the inner query is
> using the outer query.
>
> Aren't we here using the same concept ?

It's not that inner queries can't refer to outer queries. When they do it's
called a "correlated subquery" and it has to be executed once for every row of
the outer query.

It's that queries on one side of a join can't refer to tables on the other
side of the join.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's On-Demand Production
Tuning


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

Предыдущее
От: "Pascal Tufenkji"
Дата:
Сообщение: Re: Subqueries
Следующее
От: Bryce Nesbitt
Дата:
Сообщение: Seq scan on join, not on subselect? analyze this