1
DECLARE @TotalQuestions int;
DECLARE @CorrectQuestions int;
DECLARE @IncorrectQuestions int;
SELECT (
SET CorrectQuestion = SELECT COUNT(WiningComment)
FROM Threads
WHERE WiningComment IN (SELECT CommentsID
FROM Comments
WHERE [email protected])
) as 'WinningAnswers',
(
SET TotalQuestions = SELECT COUNT(CommentsID)
FROM Comments
WHERE [email protected]
) as 'TotalAnswers'
(
SELECT (TotalQuestions-CorrectQuestions) //I am not sure about this part!!
) as 'IncorrectQuestions'
我不知道最后一部分减去的结果帮帮忙,我想从另一个子查询我需要从两个查询
我认为这是正确的答案..一半测试它.. – WithFlyingColors