I have a table as follows:
User ID Service
1 2
1 3
2 1
2 3
3 5
3 3
4 3
5 2
How could I construct a query where I would count all the user ids that have a service of 3 and at least one other service?
In the above table, the query I’m interested in would return 3 because user ids 1, 2 and 3 have service of 3 and at least one other service.
Thanks!
In MS SQL: