Re: [GENERAL] why isn't this subquery wrong?
От | David G. Johnston |
---|---|
Тема | Re: [GENERAL] why isn't this subquery wrong? |
Дата | |
Msg-id | CAKFQuwbecWp41+hxyeL8qxmtuu4S6bN2XNpw8_AOkWUCzu8PDg@mail.gmail.com обсуждение исходный текст |
Ответ на | [GENERAL] why isn't this subquery wrong? (jonathan vanasco <postgres@2xlp.com>) |
Ответы |
Re: [GENERAL] why isn't this subquery wrong?
|
Список | pgsql-general |
postgres doesn't raise an error because example_a__data does have a bar_id -- but example_a__rollup doesn't and there's no explicit correlation in the query.
Subqueries can see all columns of the parent. When the subquery actually uses one of them it is called a "correlated subquery".
See another recent question on this topic for more details:
Unfortunately at present everyone here seems content answering this on the list semi-frequently instead of updating the docs and/or FAQ section of our wiki. The topic is covered (I think...) but not easily found (I failed to just now...) - and harder when you don't know what to call it in the first place.
David J.
В списке pgsql-general по дате отправления: