Re: Subselects - recursion problem

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Subselects - recursion problem
Дата
Msg-id 200505301142.57483.peter_e@gmx.net
обсуждение исходный текст
Ответ на Subselects - recursion problem  (Philip Rhoades <phil@chu.com.au>)
Список pgsql-general
Philip Rhoades wrote:
> The following script works (I have confirmed it by doing two separate
> views and doing a select on them) - but I don't understand why there
> isn't a recursion problem with c1.policy and c2.policy - is there
> some sort of trick happening?

The subquery is evaluated for each row of the outer query.  The
references to c1 are for each evaluation replaced by the current values
of the outer query.  For the purpose of the subquery, they behave like
constants.

Internally, the query might actually be transformed into a join of c1
and c2.  Maybe that helps you grasp it.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

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

Предыдущее
От: Philip Rhoades
Дата:
Сообщение: Subselects - recursion problem
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Subselects - recursion problem