Search Postgresql Archives

Re: why isn't this subquery wrong?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux