Sorry for the title but that was the best way I could think to explain it... Here is my scenario
I have a table that stores rows for communications with my clients. Something like this
| UserID | CommunicationID
-----------------------------
| User1 | com1
| User1 | com2
| User1 | com3
| User2 | com1
| User2 | com2
| User3 | com1
What I am looking for is a query that returns the UserID only for the Users who have received ALL 3 communications. So in the example above, only User1 would be returned.
I forgot to mention that I only need records where the User specifically received Com1 & Com2 & Com3. Regardless of how many times they received any one com, they have to had received all 3.
This problem came about because some users have mistakenly received com1 many times and it's thrown of my queries to identify people properly.
I had a stab at it myself trying CommunicationID IN( Com1, Com2, Com3) but of course that returns everyone. I though also about joining the table back to itself but not 100% sure how that would work.
Any sql gurus out there I would love your advice.
Thanks