Re: GROUP BY and aggregate functions - Mailing list pgsql-novice

From Henry House
Subject Re: GROUP BY and aggregate functions
Date
Msg-id 20010716085307.B2118@houseag.com
Whole thread Raw
In response to RE: GROUP BY and aggregate functions  (Stoffel van Aswegen <Stoffelva@gmsi.co.za>)
List 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

Attachment

pgsql-novice by date:

Previous
From: Dorin Grunberg
Date:
Subject: consistant output for type interval
Next
From: Tom Lane
Date:
Subject: Re: GROUP BY and aggregate functions