I would like to sum something like this: My first table shows only projects:
id |progress [%] |
1 |100 |
2 |5 |
3 |5 |
4 |100 |
5 |10 |
Second table shows tasks where project_id has the same numbers id in the first table (id = Project_id):
Project_id |status |
1 |done |
2 |done |
3 |undone |
4 |in_progress|
5 |done |
So I would like to join these two tables and get one row result:
| done | undone | in_progress |
| 2 | 1 | 0 |
I would like to sum all the tasks (second table) with their statuses but without those tasks which are inside projects (first table) with 100% progress.