I have 2 tables in my database:
And I want the following output:
I have tried with innerjoins, but then I'm returned way to many rows.
Does someone has a solution for this?
Thx!
Select ta.*,tq.Question
From TblAnswers ta
Inner Join TblQuestion tq
On ta.QuestionId=tq.QuestionId
Please try using INNER JOIN
SELECT DISTINCT
A.ID,
A.SurveyID,
A.PersonID,
A.Answer,
B.QuestionID,
B.Question
FROM TblAnswers A INNER JOIN TblQuestion B
ON A.QuestionID=B.QuestionID
Select Distinct ta.*, tq.*
from TblAnswers ta,TblQuestions tq
where ta.QuestionId=tq.QuestionId
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.