I have a table with employees and a table with errors. In my application you can assign some errors to an employee. So,
Employee A will have Error1(type 1), Error2(type 1), and Error3(type2) assigned
Employee B will have Error3(type2) assigned
and
Employee C will have Error4(type2), Error5(type2) assigned.
Hope you understand the logic.
Now:
I need to make a select which will get count of employees that have assigned strictly errors of type 2(for example).
My case will return: 2(is employee B, and employee C)
How do you suggest to make this?
I was thinking to do a select where to have employee name, total of errors assigned, and total errors assigned which are type2, but i don’t know how to make that 😐
any help will be much appreciated.
Use subqueries.
As for your query with employee name, total number of errors, and number of errors with type 2, you can do it like this: