Re: Problem with aggregate functions and GROUP BY

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem with aggregate functions and GROUP BY
Дата
Msg-id 2091.997291607@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problem with aggregate functions and GROUP BY  ("Alex Page" <alex.page@solid-state-logic.com>)
Список pgsql-sql
"Alex Page" <alex.page@solid-state-logic.com> writes:
> I'm trying to write a query that returns the rows containing the
> most recent values for each foreign key.

The best way to do this (on every dimension except portability :-()
is SELECT DISTINCT ON.  See the weather-report example in the SELECT
reference page.
        regards, tom lane


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

Предыдущее
От: "Grigoriy G. Vovk"
Дата:
Сообщение: Re: REFERENCES constraint
Следующее
От: "Grigoriy G. Vovk"
Дата:
Сообщение: Re: Functions returning more than one value