Re: I need an aggregate with 2 parameters

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: salva(at)ronincoders(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: I need an aggregate with 2 parameters
Date: 2001-03-12 23:20:50
Message-ID: 7536.984439250@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Salvador =?iso-8859-1?Q?Main=E9?= <salvamaine(at)yahoo(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-03-12 23:21:40 Re: help
Previous Message Stephan Szabo 2001-03-12 22:49:05 Re: help