> 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
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.
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
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
4 matches
Mail list logo