Re: GROUP BY and aggregate functions

Поиск
Список
Период
Сортировка
От Henry House
Тема Re: GROUP BY and aggregate functions
Дата
Msg-id 20010716085307.B2118@houseag.com
обсуждение исходный текст
Ответ на RE: GROUP BY and aggregate functions  (Stoffel van Aswegen <Stoffelva@gmsi.co.za>)
Список pgsql-novice
On Mon, Jul 16, 2001 at 03:30:37PM +0200, Stoffel van Aswegen wrote:
> You have to join a sub-select (or temp table) which has the Max() criteria.
> eg:
>
> T1
> ----
> ID
> Field1
> Field2
> ...
>
>
> SELECT *
> FROM T1
> JOIN (
>     SELECT MAX(Field1) from T1 GROUP BY ID
>     )  X
> ON x.ID = T1.ID

Ah, with a subselect it works much better :-). Thanks.

--
Henry House
OpenPGP key available from http://romana.hajhouse.org/hajhouse.asc

Вложения

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

Предыдущее
От: Dorin Grunberg
Дата:
Сообщение: consistant output for type interval
Следующее
От: Tom Lane
Дата:
Сообщение: Re: GROUP BY and aggregate functions