Hi - new to Web2py and the group. I'm building an app that will need to
perform Sum and Max against large sets of data. As I'm getting familiar
with the DAL, I've tried the following (and other combinations) rather than
fall back to db.executesql.
I'm getting the correct result but can't figure out a way to get only the
result number (68) without the (SUM(rates.val02). Probably missing
something basic but I've tried a lot of combinations and can't seem to get
there.
Thanks in advance.
Model-
db.define_table('rates',
Field('rate_name', 'string'),
Field('val01', 'integer'),
Field('val02', 'integer'),
Controller-
def sum1():
query = db.rates.val02.sum()
return dict(sum1 = db().select(query))
View-
{{=sum1}}
Result-
SUM(rates.val02)68