title: Using group by on two fields and count in SQL
body: <p>I have a table in my mysql db that has two columns: group and subgroup. See below.   </p>
  
  <pre><code> group, subGroup
   grp-A, sub-A
   grp-A, sub-A
   grp-A, sub-B      
   grp-B, sub-A
   grp-B, sub-B
   grp-B, sub-B
  </code></pre>
  
  <p>I am trying to get the number of records for each unique couple group/subGroup.</p>
  
  <p>This is what I expect:</p>
  
  <pre><code>group, subGroup, count
  grp-A, sub-A, 2
  grp-A, sub-B, 1
  grp-B, sub-A, 1
  grp-B, sub-B, 2
  </code></pre>
  
  <p>After reading some posts I tried several sql queries using group by, count(), but I do not manage to get the expected result. How can I fix this?</p>