Re: WHERE IN for JOIN subquery?

Поиск
Список
Период
Сортировка
От Dave Johansen
Тема Re: WHERE IN for JOIN subquery?
Дата
Msg-id CAAcYxUciSL7FAaqEVpeLJEWeCtE+6Pv_j5AzZj4pErOn8+R5dw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WHERE IN for JOIN subquery?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-performance
On Mon, Dec 18, 2017 at 5:10 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
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.

That appears to be what I was looking for.
Thanks,
Dave 

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: WHERE IN for JOIN subquery?
Следующее
От: Habib Nahas
Дата:
Сообщение: Autoanalyze CPU usage