I am scratching my head to figure out a solution to the following question:
I have a table with two fields, USER_ID and CLIENT_ID. For each USER_ID there are 1 to n CLIENT_IDs.
Let us say that user A is linked to clients 1,2 and 3. I want to construct a query that returns other users that also are linked to all of these clients. They may be linked to more clients, but they have to have links to all the clients of user A.
Example: User B has links to clients 1,2,3,4. User C has links to clients 1,2. The query should then return User B since User B has links to all of User A's clients. User C should not be returned, since he only has links to some but not all of the clients of User A.
This seems like a deceptively simple problem, but I can't for the life of me come up with a query that satisfies my constraints. Are the any experienced SQL gurus that can help me?