Henry House <hajhouse(at)houseag(dot)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
In response to
pgsql-novice by date
|Next:||From: Giorgio A.||Date: 2001-07-17 15:01:27|
|Subject: COUNT doesn't shows items with 0 occurrance|
|Previous:||From: Henry House||Date: 2001-07-16 15:53:07|
|Subject: Re: GROUP BY and aggregate functions|