Re: WHERE IN for JOIN subquery? - Mailing list pgsql-performance

From David G. Johnston
Subject Re: WHERE IN for JOIN subquery?
Date
Msg-id CAKFQuwYAESXM2x-jz4bgxcC20io9mh+x+Z0TjTAbaaZcbn3aWQ@mail.gmail.com
Whole thread Raw
In response to WHERE IN for JOIN subquery?  (Dave Johansen <davejohansen@gmail.com>)
Responses Re: WHERE IN for JOIN subquery?  (Dave Johansen <davejohansen@gmail.com>)
List pgsql-performance
On Mon, Dec 18, 2017 at 5:00 PM, Dave Johansen <davejohansen@gmail.com> wrote:

other = a.other
But I get this error:
ERROR:  invalid reference to FROM-clause entry for table "a"

LINE 1: ...ue), COUNT(DISTINCT value) FROM other WHERE other=a.other GR...

HINT:  There is an entry for table "a", but it cannot be referenced from this part of the query.

One possible solution to this error is to add the word "LATERAL" before LEFT JOIN so that the right side of the join can reference variables from the left side.

David J.

pgsql-performance by date:

Previous
From: Dave Johansen
Date:
Subject: WHERE IN for JOIN subquery?
Next
From: Dave Johansen
Date:
Subject: Re: WHERE IN for JOIN subquery?