title: MySQL count value by ID
body: <p>Not sure if the title explains what I am trying to do correctly however I was unable to word it.</p>
  
  <p>I am trying to create an output for a some graphs. The output I am aiming for is just the total value of some rows in a mySQL table grouped by a category ID. My tables are as follows:</p>
  
  <pre><code>Transactions:
  
  TransactiondID | TransactionName |TransactionCategory| Value
  *************************************************************
         1       |  GenericText1   |      1            | 30
         2       |  GenericText2   |      1            | 38
         3       |  GenericText2   |      2            | 38
  </code></pre>
  
  <p>And my Reference Data for TransactionCategory</p>
  
  <pre><code>TranCatID | TransCatName
  *************************
      1     | Tranportation
      2     | Petrol
  </code></pre>
  
  <p>So what I want to do is do is a SUM of the value field by each category. So I would get an output of.</p>
  
  <pre><code>Category       | Value
  ****************************
  Transportation | 68
  Petrol         | 30
  </code></pre>
  
  <p>I got this but it does not work. I think it is completely incorrect but wanted to show my attempt.</p>
  
  <pre><code>SELECT SUM( `TransactionValue`) AS Value, 
  transaction_category.transaction_category
  FROM Transactions 
  JOIN transaction_category on Transactions.TransactionID = transaction_category_id
  </code></pre>