I have a table with userID
s, a table with testID
s, and a table that pairs userID
s with testID
s. How could I, using only SQL, select each userID
once based on the highest testID
it corresponds with?
userIDTable: userID 1, userID 2, userID 3
mediatorTable: userID 1 testID 1, userID 2 testID 2, userID 1 testID 3, userID 2 testID 7, userID 3 testID 5
testIDTable: testID 1, testID 2, testID 3, testID 5, testID 7
SELECT userID 1 testID 3, userID 2 testID 7, userID 3 testID 5