(I donβt think I correctly named this question, but I donβt know how to describe it)
Here is what I am trying to do:
Say I have a Person table that has a PersonID field. And let them say that Man can belong to many groups. Thus, there is a Group table with a GroupID field and a GroupMembership table, which is a many-to-many join between two tables, and the GroupMembership table has a PersonID field and a GroupID field. So far, it has been a lot for many.
Given the list of GroupIDs, I would like to write a query that returns all the people who are in ALL of these groups (none of these groups). And the request should be able to process any number of GroupIDs. I would like to avoid dynamic SQL.
Is there any easy way to do this that I am missing? Thanks, Corey
source share