I have a table 'mat' with columns x,y,data, where (x,y) is the multi-column primary key, so the table contains data in matrix form. The problem is how to select multiple rows when I have a "vector" of key pairs and there can be repeating pairs:
SELECT x,y,data FROM mat WHERE (x,y) IN ((0,0),(0,0),(1,1));
quite obviously returns
x | y | data
--+---+-----
0 | 0 | 5
1 | 1 | 7
whereas I would need:
x | y | data
--+---+-----
0 | 0 | 5
0 | 0 | 5
1 | 1 | 7
I could loop the key pairs from outside (in c++/whatever code) to get the correct data but there's a major performance degradation and that's quite critical. Any suggestions? Is it possible? Help appreciated!