Re: How can I get the last element out of GROUP BY sets?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How can I get the last element out of GROUP BY sets?
Дата
Msg-id 20989.1074491070@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How can I get the last element out of GROUP BY sets?  (Robert Creager <Robert_Creager@LogicalChaos.org>)
Ответы Re: How can I get the last element out of GROUP BY sets?
Re: How can I get the last element out of GROUP BY sets?
Список pgsql-sql
Robert Creager <Robert_Creager@LogicalChaos.org> writes:
> ... one piece of data I need is the last value for each GROUP BY
> period.  Alas, I cannot figure out how to do this.

SELECT DISTINCT ON (rather than GROUP BY) could get this done for you.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Execute permissions for stored functions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: DROP TRIGGER