Re: I need an aggregate with 2 parameters - Mailing list pgsql-sql

From Tom Lane
Subject Re: I need an aggregate with 2 parameters
Date
Msg-id 7536.984439250@sss.pgh.pa.us
Whole thread Raw
In response to I need an aggregate with 2 parameters  (Salvador Mainé <salvamaine@yahoo.com>)
List pgsql-sql
Salvador Mainé <salvamaine@yahoo.com> writes:
> I want to select the the day of maximum value for each year for a given
> measurement station.

This is exactly the sort of thing that SELECT DISTINCT ON is meant for.
See the "weatherReports" example in the SELECT man page,
http://www.postgresql.org/devel-corner/docs/postgres/sql-select.html
        regards, tom lane


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: help
Next
From: Tom Lane
Date:
Subject: Re: help