Re: GROUP BY and aggregate functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: GROUP BY and aggregate functions
Дата
Msg-id 7864.995300294@sss.pgh.pa.us
обсуждение исходный текст
Ответ на GROUP BY and aggregate functions  (Henry House <hajhouse@houseag.com>)
Список pgsql-novice
Henry House <hajhouse@houseag.com> writes:
> I only want the value of id for the row that matches max(postdate).

The standard-conforming way involves using a subselect, as someone
else already illustrated.  A less standard but considerably faster
method is to use SELECT DISTINCT ON; there's an example in the
SELECT reference page.

            regards, tom lane

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