title: percentage of total on two group by and a sum sql
body: <p>I have a table that looks like the below:</p>
  
  <pre><code>id     Category     Spend
  ------------------------------
  00001    Apple       10
  00001    Oranges     4
  00001    Apple       21
  00001    Oranges     50
  00002    Oranges     32
  00002    Apple       2
  00002    Oranges     31
  Etc.
  </code></pre>
  
  <p>And I'm looking to produce a table that would show the below</p>
  
  <pre><code>id     Category     Spend_Ratio
  ------------------------------
  00001    Apple       36%
  00001    Oranges     64%
  00002    Apple       3%
  00001    Oranges     97%
  </code></pre>
  
  <p>The logic being to produce a ratio based on category spend grouping by ID.</p>
  
  <p>I've managed to get this far:</p>
  
  <pre><code>SELECT id, category, SUM(spend)
  FROM table
  GROUP BY id, category;
  </code></pre>
  
  <p>Absolutely lost to where to go next..</p>