title: SQL total sum by type categories
body: <p>I have an "Expenses" table with columns <code>ID</code>, <code>DATE</code>, <code>TYPE</code> and <code>AMOUNT</code>. The <code>TYPE</code> column includes different kind of expenses categories, for example rent, food, clothes etc. How could I sum total of each <strong><code>TYPE</code></strong>? In the end I would like to achieve Pareto kind of chart.</p>
  
  <p>Now I'm able to sum only one by one</p>
  
  <pre><code>SELECT SUM(AMOUNT) FROM Expenses WHERE TYPE="Food"
  </code></pre>
  
  <p>Database is MariaDB10 and manipulated with phpMyAdmin if that matters.</p>