That is correct. In 1.55 and earlier too. My exmaple had a typo: t=db.define_table('mytable',SQLField('name'),SQLField ('price','double'))
print db(t.id>0).count() rows=db(t.id>0).select(t.ALL,t.price.sum (),orderby=t.name,groupby=t.name) for row in rows: print row.mytable.name, row._extra[t.price.sum ()] On Feb 5, 11:20 am, BearXu <bearx...@gmail.com> wrote: > in 1.56 > it seems that > row.name should be row.yourtablename.name > > 2008/10/20 mdipierro <mdipie...@cs.depaul.edu> > > > > > yes. for example > > > t=db.define_table('mytable',SQLField('name'),SQLField('price','double')) > > > print db(t.id>0).count() > > > rows=db(t.id>0).select(t.ALL,t.price.sum(),orderby=t.name,groupby=t.name) > > for row in rows: print row.name, row._extra[t.price.sum()] > > > Massimo > > > On Oct 20, 3:04 am, David Marko <dma...@tiscali.cz> wrote: > > > Hello to all, > > > does web2py ORM support aggregate operations like 'sum', 'count' etc? > > > > Thanks for info, > > > David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---