I have a table to store the answers of users of our sweepstake. The table that consists of 3 fields: the userid, the questionid and the answervalue.
Now I need to find the users with the most identical answers as a certain user.
For example I may have values like this (excerpt and simplified):
Now, if I search the closest matches for user 15 I'should find out that user 495 has one match (question 1) and user 498 has two (questions 1 and 3)
I need the SQL to get this information and don't know how.
Any ideas? It shouldn't be that difficualt but after a little too less of sleep my brain is kind of resting.
Thanks a lot!