title: How to Sum Each Enum Value in a Different Column and Don't Repeat Person's Name?
body: <p>Let's say I have a table with <code>SellerId</code>, <code>DateTime</code>, <code>ProductType</code> to register each time a a Seller sells a product. The ProductType is from <code>ENUM</code> type with {0=Phone, 1=Recharge, 2=SimCard}. Then I have a table with <code>SellerId</code> and <code>SellerName</code>.</p>
  
  <p>I want to make a Stored Procedure that shows this view:</p>
  
  <pre><code>  ID | NAME | Phones | Recharges | SimCards | Total
   ----|------|--------|-----------|----------|-------
    05 | Eddy |      6 |         7 |        0 |    13
  </code></pre>
  
  <p>I know how to <code>join</code> the two tables to get the ID and NAME in this view, but I do not know how to <code>SUM</code> each <code>ProductType</code> into a different column. And I also wanted only one row for each ID/NAME.</p>
  
  <p>Can anyone show me how to achieve this in this simple example?</p>