Time Aggregates

From: Itai Zukerman <zukerman(at)math-hat(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Time Aggregates
Date: 2000-08-02 13:41:52
Message-ID: 87ittju6e7.fsf@matt.w80.math-hat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I'm currently doing this:

SELECT symbol, date_trunc('minute', posted),
min(price), max(price), avg(price)
FROM trade
GROUP BY symbol, date_trunc('minute', posted);

to get a list of minute-averages of trade prices. I get the feeling
that this is bad form, that I should be doing this some other way. Is
that the case?

-itai

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Thomas Lockhart 2000-08-02 15:27:13 Re: Time Aggregates
Previous Message Jon Lapham 2000-08-02 13:02:33 Re: on line numbers, drop table errors, and log files