yes in
rows=db().select(db.mytable.date,db.mytable.clicks.sum (),db.mytable.impressions.sum(),groupby=db.mytable.date) for row in rows: print row._extra[db.mytable.clicks.sum()] Massimo On Jul 2, 6:22 am, "Sebastian E. Ovide" <sebastianov...@gmail.com> wrote: > is there any way to access to the sum column ? in this way we would not need > to rename that column.... > > On Sat, Jun 20, 2009 at 6:43 AM, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > Changing colnames that have the form "table.field" is a NO NO. That is > > what I was referring to. > > colnames that refer to aggregates can be changed. I agree it is not a > > good idea anyway. > > > Massimo > > > On Jun 19, 3:19 pm, DenesL <denes1...@yahoo.ca> wrote: > > > On Jun 19, 8:27 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > > These are different problems. Even you could do "as", which you > > > > technically an but it is complicated, would not rename the web2py > > > > column. > > > > > You can rename the column without the "as". > > > > > rows=db(..).select(...) > > > > > rows.colnames is a list with the colnames. You can change any element > > > > in this list as you please. Look what is in there first. > > > > I believe changing colnames is a no-no. > > > > Fromhttp://groups.google.com/group/web2py/msg/b42be1fa72b2c591 > > > > <CITE> > > > Changing row.colnames changes the way to retrieve columns when you > > > change colnames. Bad. > > > > I take back my suggestion about changing colnames to change the column > > > names. DO NOT DO IT. There is a better and cleaner way: > > > > Instead of simply printing {{=rows}}, print {{=SQLTABLE > > > (rows,headers=headers)}} instead where headers is a dictionary you > > > define that looks like this: > > > > headers={'book.author':'Author'} > > > > the headers names in the dictionary will be renamed accordingly. > > > </CITE> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---