Re: [sqlite] DISTINCT on a JOIN

2011-09-23 Thread Frank Missel
> 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

Re: [sqlite] DISTINCT on a JOIN

2011-09-23 Thread Simon Slavin
On 23 Sep 2011, at 12:57pm, Igor Tandetnik wrote: > select name, >(select count(*) from people where course=courses.id), >(select count(*) from tasks where course=courses.id) > from courses; Thank you thank you thank you Igor. I must learn how to use sub-selects properly. Simon.

Re: [sqlite] DISTINCT on a JOIN

2011-09-23 Thread Igor Tandetnik
Simon Slavin wrote: > I have a setup which I will simplify as follows: > > There is a table of courses. > Every course can have any number of people working on it. > Every course involves any number of tasks. > > I want to make a SELECT which will return a table as

[sqlite] DISTINCT on a JOIN

2011-09-23 Thread Simon Slavin
I have a setup which I will simplify as follows: There is a table of courses. Every course can have any number of people working on it. Every course involves any number of tasks. I want to make a SELECT which will return a table as follows: course1 number-of-people-involved-in-course1