In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!
and the output looks like this:
SELECT Q.questionID, G.groupID, COALESCE(SUM(R.questionResponse),0) FROM questions Q LEFT JOIN questionResponses R ON Q.questionID = R.questionID LEFT JOIN groups G ON G.groupID = R.groupID WHERE Q.questionID IN ( 244,245,246 ) GROUP BY Q.questionID, G.groupID ORDER BY Q.questionID