pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Salvador Mainé <salvamaine@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: SQL problem
Date: Wed, 07 Mar 2001 13:23:23 -0100
Message-ID: <3AA6445B.F409966F@yahoo.com> (raw)

Hello:

I have a table with pluviometrical data

meteo (rain float, day date)

I want to select the the day of maximum value for each year.It should be
something like :


select max(rain),day from meteo group by date_part('year', day);


but it obiously doesn't work.
I thought of doing it with aggregates, but it's far too complicated. Is
there an 'easy' way to do this?


 

-- 
Salva



view thread (8+ messages)  latest in thread

Message-ID: <3AA6445B.F409966F@yahoo.com>
Permalink:  ../3AA6445B.F409966F@yahoo.com/
Also on:    postgresql.org/message-id/3AA6445B.F409966F@yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: salvamaine@yahoo.com
  Subject: Re: SQL problem
  In-Reply-To: <3AA6445B.F409966F@yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox