I have a table with two columns of identifiers.
TABLE
id1 id2
1 1
1 2
1 3
2 1
2 6
2 2
3 1
3 10
3 3
I would like to select every id1 that matches a specific id2s combination.
For example, if I have id2 = [1, 2, 3], I would like to return id1 = [1];
If I have id2 = [1, 6], I would like to return id1 = [2];
If I have id2 = [1], I would like to return id1 = [1, 2, 3].
Any suggestions on how best to accomplish this would be appreciated.
Thank,
source
share