title: MySQL query to sum all distinct values
body: <p>I have a table: </p>
  
  <pre><code>uid_from uid_to count
     x1      x2    3 
     x3      x2    5
     x8      x1    99
     x9      x1    1
  </code></pre>
  
  <p>And would like to generate a summ table like this:</p>
  
  <pre><code>uid_to   sum
    x1     100
    x2      8
  </code></pre>
  
  <p>I can do it in PHP, but would rather do it directly in a MySQL query. I should note the table has 700 Million rows. </p>