There is a table "T" that contains data as shown below:
A B
---------
3 5
4 6
7 10
8 5
9 12
3 6
3 7
8 7
Assuming a given input set of {3,8} as values for A, how to retrieve all distinct values of B for which all values in the input set has an entry?
B
---
5
7
EDIT: I think the question is not clear enough. I want values in B which have a record with all values in the given set as a value for column A. So, B=6 will not be included since there is no record with A=8 and B=6. Hope this makes it clear!