I have a many-to-many relationship between Users and Tasks
Users (id, name ..)
task_user (user_id, task_id)
Tasks (id, task, state) (STATE = finalized, process, delayed)
I need to bring the number of total tasks per user and how many are completed, in process, delayed, which is not coming out.
For example
Juan Lopez
Total tasks 35
In process: 7
Delayed: 9