You need to ensure the attributes are set up properly, specifically:
Workgroup is a separate object;
Attribute Alert.TargetWorkgroup is of type Workgroup, multiples not allowed;
Attribute Workgroup.StaffMembers is of type StaffMember, multiples allowed.
Then the query should work.