Re: FIRST_VALUE argument must appear in group by?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: FIRST_VALUE argument must appear in group by?
Дата
Msg-id CAKFQuwZZtatL-S=XUgMbGA1RExqTQZZ6SaG3B_bKSd4WatSFcQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: FIRST_VALUE argument must appear in group by?  (Guyren Howe <guyren@gmail.com>)
Ответы Re: FIRST_VALUE argument must appear in group by?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On Tue, May 17, 2016 at 1:36 PM, Guyren Howe <guyren@gmail.com> wrote:
I am trying to use a window function, but it's not working. The subquery is effectively aggregating.


​I would advise avoiding using select-list scalar (and particularly correlated) subqueries when the query level in question also contains a group by.  Do the group by in a subquery and then in the parent query pull in whatever subselects you want to execute.

You need to make it easier for people to help.  The first post you sent was just a window function.  I asked for​
 
​detail and you sent a query without one.  Given that discrepancy, added to the fact the query is question is not self-contained, I am less than inclined to try and figure out what you are trying to do.

Given me a query that has a window function and looks like, if said window function was removed, it would successfully run, and I'll made an educated guess.

David J.

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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Thoughts on "Love Your Database"
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: FIRST_VALUE argument must appear in group by?