Hi!
There are many aliases with sub select  in your query, it's difficult to 
understand tables structure.
Post tables definition and some comment about what do you want to do, please




On Monday, February 29, 2016 at 8:11:09 AM UTC+3, Bill Black wrote:
>
> SELECT a.*,b.num_passed
>   FROM (SELECT q.id,q.name,count(t.id) AS num_q
>     FROM quiz AS q
>       JOIN question AS t ON q.id=t.quiz_id GROUP BY q.id)
> AS a
>   JOIN (SELECT quiz_id,count(passed) AS num_passed FROM result GROUP BY 
> quiz_id)
> AS b ON a.id=b.quiz_id;
> I need to join these two selects.
> I've spent all morning trying to get it to work in dal. But I don't think 
> it can be done...
> Just posting here in case there is a way to do this before resorting to 
> executesql.
> Thanks.
>

-- 
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/d/optout.

Reply via email to