title: SQL group by, what am I doing wrong?
body: <p>The situation is as follows:</p>
  
  <p>Find the top 5 Community Areas by average College Enrollment.</p>
  
  <p>The DB is stored as SCHOOLS.</p>
  
  <pre><code>%sql SELECT COLLEGE_ENROLLMENT, COMMUNITY_AREA_NAME FROM SCHOOLS GROUP BY COLLEGE_ENROLLMENT;
  </code></pre>
  
  <p>I understand that this would give me the college enrollment by community, but I get the error message of this:</p>
  
  <p>(ibm_db_dbi.ProgrammingError) ibm_db_dbi::ProgrammingError: Exception('SQLNumResultCols failed: [IBM][CLI Driver][DB2/LINUXX8664] SQL0119N  An expression starting with "COMMUNITY_AREA_NAME" specified in a SELECT clause, HAVING clause, or ORDER BY clause is not specified in the GROUP BY clause or it is in a SELECT clause, HAVING clause, or ORDER BY clause with a column function and no GROUP BY clause is specified.  SQLSTATE=42803\r SQLCODE=-119')</p>
  
  <p>Can anyone give me a lead on what I'm doing wrong here?</p>
  
  <p>Thank you!</p>