
The underlying problem is an inappropriate table design.
The user of aliases for the real field names helps expose this problem:
ItemTypeA | ItemTypeB | ItemTypeC | ItemTypeD | ItemTypeE |
---|
Whenever you see this pattern of "Something" + a counter, that's a sign the original data was either in Excel or a table created without considering good relational table design.
So, the solution is to Normalize this table properly so that the query becomes simple and direct.
Actually, you need three tables here:
Employees
Items
EmployeeItemAssignments
Employees needs its Primary Key, such as EmployeeID.
Items needs its Primary Key, such as ItemID.
In the third table, you have one record for each employee and Item combination.
If an employee is assigned one item, there will be only one record for that employee-item assignment.
If an employee is assigned two items, there will be two records for that employee with the two item assignments.
These assignments are designated by including the appropriate EmployeeID and the appropriate ItemID for each assignment.
Additional fields could include the date the assignment was made and the date it ended, if that's relevant to your business model.
That's a narrative explanation. For a deeper background, I suggest investing time in researching Database Normalization. Look for Many-to-Many relationships and how they are handled properly.
I expect you'll receive additional, more technically detailed responses, as well.
The key point is that improper, or non-normalized tables make for rough sledding when you need to query them.