title: Year vs Month table in postgresql
body: <p>I'm currently working in a sql project using PostgreSQL, now my results look like this:</p>
  <pre><code>month | year | sales
  ----- + ---- + -----
    7   | 2019 | 5300
    8   | 2019 | 6600
    9   | 2019 | 7100
    7   | 2020 | 6900
    8   | 2020 | 8800
    9   | 2020 | 9500
  </code></pre>
  <p>With this code:</p>
  <pre><code>select date_part('month', points_reward.created) as mes,
     date_part('year', points_reward.created) as ano,
     sum(available_points) as &quot;sales&quot;
  from points_reward
  group by 1,2
  </code></pre>
  <p>I'm trying to create a table that show me the month vs year like this:</p>
  <pre><code>      | 2019 | 2020
    --- + ---- + ----
    7   | 5300 | 6900
    8   | 6600 | 8800
    9   | 7100 | 9500
  </code></pre>
  <p>Thanks in advance for any hint or help and for taking the time to read.</p>