title: Postgres select sum by months
body: <p>I have table evidence:</p>
  
  <pre><code>id      id_customer     id_service     amount       date 
  1           1                1          50.0        2018-01-10
  2           2                1          15.7        2018-01-18
  3           3                2          14.9        2018-02-07
  4           1                3          700.0       2018-02-28
  5           2                1          250.0       2018-03-19
  6           3                2          315.7       2018-03-08
  7           1                1          100.0       2018-04-28
  8           2                2          132.0       2018-04-26
  </code></pre>
  
  <p>I want to make SUM by month of year 2018 and have output like this:</p>
  
  <pre><code>  amount  month
      65.7     1
      714.9    2
      565.7    3
      232.0    4
  </code></pre>
  
  <p>This is my select which I want help with.</p>
  
  <pre><code>select sum(amount),extract(month from date) from evidence where extract(year from date)=2018 and amount&gt;0 group by date;
  </code></pre>