title: Counting Number of Males/females within a blood group
body: <p>So I have two Data Tables 'DONOR' AND 'ACCEPTOR'. Each have the following schema: </p>
  
  <pre><code>DID|NAME|GENDER|CITY|BG |AMOUNT
  INT|STR |CHAR  |STR |STR|INT
  </code></pre>
  
  <p>I'm trying to create a query to output the <em>Gender</em> and <em>Blood Group (BG)</em> as well as a <em>Count</em> for that Gender+Blood Group to do this I created the following query which is kind of correct but I only want it to output each Gender+Blood Group once with the total count which i don't exactly understand how to do (I'm learning SQL and I figured out how to get this query and union it but not make it so each Gender + Blood Group only outputs once)</p>
  
  <p><strong>My Query:</strong></p>
  
  <pre><code>SELECT DISTINCT GENDER,BG,COUNT(BG) COUNTVALUE FROM DONOR GROUP BY GENDER,BG
  UNION ALL
  SELECT DISTINCT GENDER,BG,COUNT(BG) COUNTVALUE FROM ACCEPTOR GROUP BY GENDER,BG
  </code></pre>
  
  <p><strong>Example Output:</strong></p>
  
  <pre><code>F A+ 30
  F AB+ 75
  M A- 47
  M AB+ 36
  M 0+ 53
  . . .
  </code></pre>
  
  <p><strong>My Output:</strong></p>
  
  <pre><code>F A+ 69 
  F A- 49 
  F AB+ 62 
  F AB- 61 
  F B+ 67 
  F B- 63 
  F O+ 45 
  F O- 59 
  M A+ 55 
  M A- 71 
  M AB+ 76 
  M AB- 63 
  M B+ 59 
  M B- 68 
  M O+ 67 
  M O- 66 
  F A+ 51 
  F A- 57 
  F AB+ 71 
  F AB- 62 
  F B+ 60 
  F B- 70 
  F O+ 52 
  F O- 69 
  M A+ 70 
  M A- 60 
  M AB+ 71 
  M AB- 68 
  M B+ 66 
  M B- 53 
  M O+ 52 
  M O- 68 
  </code></pre>