fmax=db.table.field.max(),
fmin=db.table.field.min()
fcount=db.table.field.count()
fsum=db.table.field.sum())
rows = db(query).select(fmax,fmin,fcount,fsum)
vmax=rows[0][fmax]
vmin=rows[0][fmin]
vavg=rows[0][fsum]/(rows[0][fcount] or 1)

does not work on GAE

On Nov 16, 2:29 pm, Lorin Rivers <[email protected]> wrote:
> I've got data with many, many rows, one record for each device that's being 
> sampled every 6 seconds. I'm trying to roll up some of this data by getting 
> the max, min, and average in a time span (for example, a minute).
>
> Is there a way to do that with the rows object? Or do I have to craft queries 
> for each time span to get the max, min, and count?
>
> I tried using find on rows but couldn't get max to work with that.
>
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing <http://www.mosasaur.com>
> <mailto:[email protected]>
> 512/203.3198 (m)

Reply via email to