title: SQl query to sum-up amounts by month/year
body: <p>I have a table "TABLE" like this:</p>
  
  <pre><code>Date(datatime)
  Paid(int)
  </code></pre>
  
  <p>I have multiple "Paid" amounts per month.
  I would like to sum up the Paid amount per month/year.</p>
  
  <p>So far this is what I tried but I get errors in EXTRACT and in MONTH and however I am far to get it done with the years.</p>
  
  <pre><code>SELECT 
       EXTRACT(MONTH FROM Period) AS reference_month
       , SUM(Paid) AS monthly_payments 
  FROM Paid 
  GROUP BY EXTRACT(MONTH FROM Period) 
  ORDER BY EXTRACT(MONTH FROM Period)
  </code></pre>
  
  <p>I am not really handy at this and I would really appreciate some help.</p>