MySQLFiddle here: http://sqlfiddle.com/#!2/15d447/1
I have one table I'm trying to work with:
Table 1: user_answers table (stores user answers to various questions)
Significant values โโare user identifiers ( uid column), question identifier for answering a question ( quid column), answer to a question ( answer column) and the importance of their answer ( importance column).
Final result:
I would like to get all the questions that any two users answered, with the exception of answers to questions that the other side did not answer, or answers to the same question, which has a value of 1 for the user in importance . Again, this will only ever be used to compare two users at a time.
In my attempts, I was pretty unsatisfactory, but here is what I tried, just putting things together:
This does not return results, but I'm not quite sure why.
This gives me the results, but seems to double everything due to the connection. I also tried in this attempt to eliminate any answers, which was the same thing that seems to work in that sense.
Any guidance is appreciated.
Thanks.
user1026996
source share