Questions Not Answered in given waves
SELECT *
FROM dbo.vw_Question_list VQL
WHERE VQL.QuestionId IN
(
SELECT DISTINCT
uaq.QuestionId
FROM dbo.Wave W
INNER JOIN dbo.Assessment A ON W.Id = A.WaveId
AND a.IsActive = 1
AND a.CompletedDate IS NOT NULL
INNER JOIN dbo.UserAssessmentQuestion uaq ON A.AssessmentId = uaq.AssessmentId
AND uaq.IsActive = 1
AND uaq.IsCorrect = 0
WHERE w.Id IN(100, 103)
) ORDER BY 1;