title: Select multiple years in separate columns
body: <p>I have a table that stores the date and price of purchases.</p>
  
  <p>For example</p>
  
  <pre><code>date       | price
  ---------------------
  2014-1-12  | 6.50
  2014-2-34  | 10.99
  2015-1-01  | 3.22
  2015-2-14  | 4.12
  </code></pre>
  
  <p>And so on.</p>
  
  <p>What I want to achieve: A query that outputs the SUM of the purchases grouped per month of the year. </p>
  
  <p>The IMPORTANT thing is, though, that I need to have the different years in COLUMNS to be able to make a graph with a separate line for each year. So the output I need is this:</p>
  
  <pre><code>MONTH | 2014    |  2015 
  JAN   |  123.23 |  99.1
  FEB   |  457.00 |  122.00
  MAR   |  299.99 |  789.12
  ...   |
  NOV   |  333.33 | 10.99
  DEC   |  100.00 | 20.10
  </code></pre>
  
  <p>Is this even possible? I searched quite a long time for things like "year on year" query etc. But I could not find anything.</p>
  
  <p>Any help is greatly appreciated!</p>