title: ALTERNATE TO SQL GROUPBY (such as to avoid repeating on aggregate fields)
body: <p>Is there any way to have a query return say 8 fields but only group by one field and perform only one aggregate function on another field? 
  I get an error that suggests that i need to group by by all fields that do not have aggregate functions.</p>
  
  <p>I need to find the number of completed surveys for each month but need to include other information such as session starttime, session status, session id, etc.</p>
  
  <p>When I try to execute this:  </p>
  
  <pre><code>SELECT Datepart("m", starttime), 
         COUNT(sessionid), 
         sessionstatus, 
         starttime, 
         endtime, 
         surveyid, 
         surveybook, 
         userdesk 
  FROM   survey_sessions 
  GROUP  BY Datepart("m", starttime) 
  </code></pre>
  
  <p>I get the error:
   "You tried to execute a query that does not include the specified expression 'SessionStatus' as part of an aggregate function"</p>
  
  <p>I do not need any other aggregates and grouping by the remaining fields does not give me ability to get the monthly total.</p>