Re: [GENERAL] why isn't this subquery wrong?

Поиск
Список
Период
Сортировка
От jonathan vanasco
Тема Re: [GENERAL] why isn't this subquery wrong?
Дата
Msg-id 0DFA6224-CC42-4A3B-B192-CE877D09960B@2xlp.com
обсуждение исходный текст
Ответ на Re: [GENERAL] why isn't this subquery wrong?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: [GENERAL] why isn't this subquery wrong?
Список pgsql-general
thanks all!

On Apr 20, 2017, at 6:42 PM, David G. Johnston wrote:

​Subqueries can see all columns of the parent.  When the subquery actually uses one of them it is called a "correlated subquery".

i thought a correlated subquery had to note that table/alias, not a raw column.   I guess i've just been adhering to good form.


On Apr 20, 2017, at 6:43 PM, Tom Lane wrote:

Cautious SQL programmers qualify all references inside sub-selects to avoid getting caught by this accidentally.

is there a syntax to qualify a reference to lock a subquery to the current scope (disable looking at the parents)?  that's how I got caught on this by accident.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] why isn't this subquery wrong?
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: [GENERAL] why isn't this subquery wrong?