I have the following two tables.
SurveyTable:
QID | Text ---------------------------------------- 1 | Favorite movie 2 | Favorite book 3 | Favorite city
SurveyResponses:
UserID | QID | Answer ---------------------------------------- 1001 | 1 | StarWars 1001 | 2 | Harry Potter 1001 | 3 | Los Angeles 1003 | 3 | New York
I would like to get a response which also has all the questions that the User did not answer in the survey.
Expected Output of SQL join:
UserID | QID | Answer ---------------------------------------- 1001 | 1 | StarWars 1001 | 2 | Harry Potter 1001 | 3 | Los Angeles 1003 | 1 | - 1003 | 2 | - 1003 | 3 | New York
I tried various SQL query combinations but no luck. Please help.