我的数据库中有2个表:
我想要以下输出:
我尝试过使用innerjoins,但后来我回到了很多行。
有人有解决方案吗?
THX!
答案 0 :(得分:1)
Select ta.*,tq.Question
From TblAnswers ta
Inner Join TblQuestion tq
On ta.QuestionId=tq.QuestionId
答案 1 :(得分:1)
请尝试使用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
答案 2 :(得分:0)
Select Distinct ta.*, tq.*
from TblAnswers ta,TblQuestions tq
where ta.QuestionId=tq.QuestionId