Re: [SQL] Time Aggregates

2000-08-02 Thread David Lloyd-Jones
"Thomas Lockhart" <[EMAIL PROTECTED]> replied to: "Itai Zukerman" <[EMAIL PROTECTED]> > > 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

Re: [SQL] Time Aggregates

2000-08-02 Thread Itai Zukerman
> > SELECT symbol, date_trunc('minute', posted), > > min(price), max(price), avg(price) > > FROM trade > > GROUP BY symbol, date_trunc('minute', posted); Hmmm... I'm not sure how to go about doing this for, say, 5 minute intervals. Basically, I want a function: date_round( time

Re: [SQL] Time Aggregates

2000-08-02 Thread Thomas Lockhart
> 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

[SQL] Time Aggregates

2000-08-02 Thread Itai Zukerman
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 doi