title: SQL GROUP BY with COUNT() Not grouping correctly
body: <p>Hi so i'm doing a small hobby project and i'm trying to get a GROUP BY clause to work correctly but it's not grouping the results instead it just takes one column.</p>
  
  <p>Example:</p>
  
  <pre><code>Table classes ( guID, className )
  Table student ( guID, name, classID)
  Table grades  ( s_id, c_id, grade)
  </code></pre>
  
  <p>For example return the number of a certain grade for a whole class:</p>
  
  <p>Students:</p>
  
  <pre><code>"Alex", "class1"
  "Kevin", "class1"
  "Lisa", "class2"
  </code></pre>
  
  <p>Grades:</p>
  
  <pre><code>"alex_id", "course_id", "B"
  "alex_id", "course_id", "A"
  "kevin_id", "course_id", "A"
  "lisa_id", "course_id", "C"
  </code></pre>
  
  <p>QUERY:</p>
  
  <pre><code>SELECT classes.className, (SELECT COUNT(*) FROM grades WHERE s_id = student.guID AND   grade = "A") as Total_Grades
  FROM classes
  INNER JOIN student
  ON classes.guID = student.classID
  WHERE classes.guID = 1
  GROUP BY classes.className;
  </code></pre>
  
  <p>This only gives the result:</p>
  
  <pre><code>"class1", 1
  </code></pre>
  
  <p>Where it should give:</p>
  
  <pre><code>"class1", 2
  </code></pre>
  
  <p>Would appreciate some help if someone got some spare time.</p>