I have an ItemList table where there is a groupID column and an itemID column (which can be 1, 2 or 3). What I’d like to do is return the data where the groupID has itemID’s 1, 2 AND 3.
I’ll illustrate below with some sample data:
GroupID ItemID
1 1
2 1
2 2
2 3
3 1
3 2
4 1
4 2
4 3
5 1
5 2
And the data I’d like out of that would be:
GroupID ItemID
2 1
2 2
2 3
4 1
4 2
4 3
Any ideas how I’d achieve this?
Thanks
You can use EXISTS() queries to check the conditions, like so: