title: Group By with count doesn't work
body: <p>I am trying to use group by with count function but this doesn't work. </p>
  
  <pre><code>SELECT 
      projects.AgencyId,
      projects.ProgramId,
      count(projects.ProjStatusByMin) as status,
      projects.ProjStatusByMin 
  from 
      projects 
  where 
      projects.AgencyId=40 
  group by 
      projects.ProjStatusByMin
  </code></pre>
  
  <p>This above code works in MySQL perfectly now i want to achieve the same thing in SQL Server. </p>
  
  <pre><code>Select 
      ProjStatusByMin,
      COUNT(ProjStatusByMin) [projstatus] 
  from 
      Projects
  where 
      AgencyId=40 
  group by 
      ProjStatusByMin,AgencyId,ProjId
  </code></pre>
  
  <p>However if i select a single column like the bellow code then group by work</p>
  
  <pre><code>Select 
      ProjStatusByMin,
      COUNT(ProjStatusByMin) [projstatus] 
  from 
      Projects
  where 
      AgencyId=40 
  group by 
      ProjStatusByMin
  </code></pre>
  
  <p>Now how can I achieve group by with multi column selected?</p>