As per subject - I am trying to replace slow SQL IN statement with an INNER or LEFT JOIN. What I am trying to get rid of:
SELECT
sum(VR.Weight)
FROM
verticalresponses VR
WHERE RespondentID IN
(
SELECT RespondentID FROM verticalstackedresponses VSR WHERE VSR.Question = 'Brand Aware'
)
The above I tried replacing with
SELECT
sum(VR.Weight)
FROM
verticalresponses VR
LEFT/INNER JOIN verticalstackedresponses VSR ON VSR.RespondentID = VR.RespondentID AND VSR.Question = 'Brand Aware'
but unfortunately I'm getting different results. Can anyone see why and if possible advise a solution that will do the job just quicker? Thanks a lot!