I have a table with the following data
key code
============
key1 220
key1 221
key2 220
key2 221
key2 222
key3 220
key4 255
key5 220
key5 221
A combination of key and code cannot repeat in the table (the 2 columns are used as composite primary keys).
I will like a query that will select the matching keys for a given set of codes e.g. for codes 220, 221, the expected result will be key1 and key 5 because only these match exactly these code set.
Insert the values you are looking for to a table variable
@Matchand use that in a query against your table@T.https://data.stackexchange.com/stackoverflow/q/119432/