I need a query that would compare two tables and find exact matching set of rows. I have two tables
First table
ID uniqueKey
1 A
2 A
3 A
1 B
2 B
4 C
IF i pass another table with following data
ID
1
2
3
Then it should return 'A'
If the input table is
ID
1
2
It should return 'B'
IF the input table is
ID
1
2
3
4
It should not return anything
If the input table is
ID
1
Then it should not return anything