Search Postgresql Archives

Re: why isn't this subquery wrong?

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

 



On Thu, Apr 20, 2017 at 3:17 PM, jonathan vanasco <postgres@xxxxxxxx> wrote:
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.


[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