Unfortunately, you can't use SQLALL objects in a list like that. Probably 
the best you can do is:

rows = db(some_query).select(count, db.table1.ALL, db.table2.ALL, left=left,
                             groupby='%s, %s' % (db.table1.ALL, db.table2.
ALL))

Anthony

On Tuesday, March 4, 2014 6:08:42 AM UTC-5, Marin Pranjić wrote:
>
> I guess I never did it before, which is weird because it looks like usual 
> requirement.
>
> I have a DB query where I need to get a join of two tables and aggregate 
> from third table.
> That means I need to set two tables in groupby.
>
> To describe what *doesn't *work but you'll get the idea what I want:
>
> count = db.table3.id.count()
> left = db.table3.on(something)
> rows = db(some_query).select(count, db.table1.ALL, db.table2.ALL, left=
> left, *groupby=[db.table1.ALL, db.table2.ALL]*)
>
> So the groupby thing is not working and I don't see an easy way to do it. 
> I could extract fields from SQLALL object but that's not a way to go. It 
> should be easier :)
>
> Marin
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to