title: SQL Query with group by clause, but counting two distinct values as if they were the same
body: <p>I have a simple table with two columns, like the one below:</p>
  
  <pre><code>Id | Name
   0 |   A
   1 |   A
   2 |   B
   3 |   B
   4 |   C
   5 |   D
   6 |   E
   7 |   E
  </code></pre>
  
  <p>I want to make a SQL query which will count how many times each "Name" appears on the table. However, I need a few of these values to count as if they were the same. For example, a normal group by query would be:</p>
  
  <pre><code>  select Name, count(*)
      from table
  group by Name
  </code></pre>
  
  <p>The above query would produce the result:</p>
  
  <pre><code>Name | Count
    A  |   2
    B  |   2
    C  |   1
    D  |   1
    E  |   2
  </code></pre>
  
  <p>but I need the query to count "A" and "B" as if they were only "A", and to count "D" and "E" as if they were only "D", so that the result would be like:</p>
  
  <pre><code>Name | Count
    A  |   4            // (2 "A"s + 2 "B"s)
    C  |   1
    D  |   3            // (1 "D"  + 2 "E"s)
  </code></pre>
  
  <p>How can I make this kind of query?</p>