> course1       number-of-people-involved-in-course1
number-of-tasks-involved-in-course1
> course2       number-of-people-involved-in-course2
number-of-tasks-involved-in-course2
> course3       number-of-people-involved-in-course3
number-of-tasks-involved-in-course3
> course4       number-of-people-involved-in-course4
number-of-tasks-involved-in-course4

This can be produced by:

select crs.id
     , crs.name
     , (select count(id) from people pe where pe.course = crs.id) as
num_people
     , (select count(id) from tasks ta where ta.course = crs.id)        as
num_tasks
from courses crs
;

Result:
14  starter  course  2   2



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to