我有以下 SQL。
SELECT t0.QustionId, t1.QuestionText, t2.AnswerText FROM
ActiveQuestion AS t0
INNER JOIN Question AS t1
ON t1.QuestionId = ActiveQuestion.QuestionId
LEFT OUTER JOIN Answer AS t2
ON t2.SectionId = t0.SectionId
AND t1.ParentId IN
(SELECT QuestionId
FROM Question WHERE SharedQuestionId = t2.SharedQeustionId)
问题可以共享(具有相同的 SharedQuestionId),问题可以有父问题。
我想摆脱子查询。正确的方法是什么?