Re: Why oh why is this join not working?

Поиск
Список
Период
Сортировка
От Pól Ua Laoínecháin
Тема Re: Why oh why is this join not working?
Дата
Msg-id CAF4RT5Qqi6LPvHzK-_ZO78awguVJ5ux3FTqC_Z6T-A6LocN4Ug@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Why oh why is this join not working?  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-novice
Hi Laurenz, and thanks for your contribution,

> > ERROR: column t1.englmark does not exist LINE 19: AND t1.englmark = t2.maxmark

> You cannot refer to a column alias in a WHERE condition,
> because grouping takes place *after* the WHERE condition
> has been evaluated.

Yes - of course! And nor can I refer to an aggregate! Thanks for
pointing out what I should have known at this stage! I'm putting it
down to late-night fatigue yesterday.

I'm just wondering if there are significant performance implications
associated with deeper levels of nesting?

I was attempting to look at using Window/Analytic functions to get
this done, but I just can't see it. I think that your solution (and
explanation) is optimal for this particular use case - a PIVOT (pity
it's not available by default in PostgreSQL!) is essential and there's
no (what I see as) a more elegant way.

Thanks again for your input,

Regards,

Pól...


> Laurenz Albe



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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Why oh why is this join not working?
Следующее
От: "Vianello, Dan A"
Дата:
Сообщение: RE: Why oh why is this join not working?