Re: Multiple level aggregate

2009-11-17 Thread despy
Thanks Tony. I'm ideally looking for a way to do this through models rather than SQL On Nov 16, 11:28 pm, Tony Czeh <tony.c...@gmail.com> wrote: > On 11/16/09 1:12 PM, despy wrote: > > > > > > > Hi, > > > I'm trying to get my head around a complex aggregate

Multiple level aggregate

2009-11-16 Thread despy
Hi, I'm trying to get my head around a complex aggregate query and I could do with some help. Say I have the following models StockMarket | Stock | StockPrice If StockPrice has price and date fields, and one price entry for every day for every stock how would I write a query to get the average