Re: Multiple level aggregate

2009-11-18 Thread Adam Knight
On Nov 16, 2009, at 12:12 PM, despy wrote: > 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 ever

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 wrote: > On 11/16/09 1:12 PM, despy wrote: > > > > > > > Hi, > > > I'm trying to get my head around a complex aggregate query and I could > > do with some help. Say I have the follo

Re: Multiple level aggregate

2009-11-16 Thread Tony Czeh
On 11/16/09 1:12 PM, despy wrote: > 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 e

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 p