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

From Tom Lane
Subject Re: GROUP BY and aggregate functions
Date
Msg-id 7864.995300294@sss.pgh.pa.us
Whole thread Raw
In response to GROUP BY and aggregate functions  (Henry House <hajhouse@houseag.com>)
List 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 by date:

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