I have the following data:
ID --- ParentID --- DataValue
1 --- 1 --- 1
2 --- 1 --- 2
3 --- 1 --- 6
4 --- 2 --- 1
5 --- 2 --- 2
6 --- 2 --- 4
7 --- 3 --- 1
8 --- 3 --- 3
9 --- 3 --- 5
For each group of records (grouped by ParentID), I would like to find all groups that match all given values in DataValue, for example:
- for values (1,2) ParentID 1 and 2 would be returned
- for values (1,6) only ParentID 1 would be returned (ParentID 2 group doesn't contain 6)
I looked at this question, which is very similar but OP looks for groups that do not contain single value.
Any help is greatly appreciated!