title: group by county sql query
body: <p>I'm trying to group by County and order by county in the query below, it's not working.  How can I get it to group by and order by county?</p>
  
  <pre><code>    select COUNT(sr.Response) as 'Number Of Responses', 
      County = 
      (select qpa.PossibleAnswerText from CaresPlusParticipantSurvey.QuestionPossibleAnswer as qpa 
      join CaresPlusParticipantSurvey.SurveyResponse as sr1 on qpa.Id = sr1.QuestionPossibleAnswerId
      where (sr1.QuestionId = 1 and sr.SurveyId = sr1.SurveyId)) 
  
      FROM CaresPlusParticipantSurvey.SurveyResponse as sr
      where (sr.Response is not null and CAST(sr.Response as int) &lt; 6) and (sr.QuestionId = 8)
      Group BY sr.Response, sr.SurveyId
      Order by County
  </code></pre>
  
  <p>The results below are the current results with the current query.  I want it to group by county so 4   Alameda       1 Colusa     8 Contra Costa</p>
  
  <pre><code>    1   Alameda
      1   Alameda
      1   Alameda
      1   Alameda
      1   Colusa
      1   Contra Costa
      1   Contra Costa
      1   Contra Costa
      1   Contra Costa
      1   Contra Costa
      1   Contra Costa
      1   Contra Costa
      1   Contra Costa
  </code></pre>