title: How do I sum the results of a select that returns multiple rows
body: <p>I have a SQL variable <code>@SumScore dec(9,4)</code></p>
  
  <p>I am trying to assign the variable as follows:</p>
  
  <pre><code>SET @SumScore =   
          (  
              SELECT Sum(  
                  (  
                      SELECT SUM(etjs.CalculatedScore * sc.PercentOfTotal) as CategoryScore   
                      FROM tblEventTurnJudgeScores etjs 
                          INNER JOIN tblJudgingCriteria jc ON  jc.JudgingCriteriaID = etjs.JudgingCriteriaID  
                          INNER JOIN tblScoringCategories sc ON jc.ScoringCategoryID = sc.ScoringCategoryID  
                      GROUP BY jc.JudgingCriteriaID  
                  ) 
              As ComputedScore) AS SumTotalScore  
          )  
  </code></pre>
  
  <p>In other words the inner select is returning one column. I want the var to be assigned the SUM of all of the rows that are being return there.</p>
  
  <p>I realize that this could be done with a temp table pretty easily. But is that the only way?</p>