w*r 发帖数: 2421 | 2 Your query sucks, give this a try, you better have index on isdeleted/
deleteds on both questions and
answers table. EV table also needs index. Otherwise, it will suck anyway.
SELECT
Questions.QuestionID,
Questions.QuestionText,
Answers.AnswerText,
Answers.CorrectAnswer,
Answers.PointValue AS AnswerPointValue,
CASE WHEN S1.AnswerID ID NOT NULL
THEN 1
ELSE 0
END AS AnswerUsed
FROM Questions
INNER JOIN
Answers
ON
(Questions.QuestionID = Answers.QuestionID
AND ANSWE |
|