For a many to many relationship, for example Classes and Students, I'd like to select all Classes with exactly a given membership.
Students Classes StudentClass
========= ============ =================
id id student class
-- --- -------- -------
1 1 1 1
2 2 2 1
3 3 1
4 1 2
5 2 2
3 2
4 2
With example data, If I give the query S1, S2, S3 - it should return Class 1 only, and exclude Class 4 because it contains an additional student.