title: Postgresql PIVOT
body: <p>I'm pretty new in the world of sql queries and would appreciate help with pivoting.
  I have a table similar to this one:</p>
  
  <p><a href="https://i.stack.imgur.com/7SrYo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7SrYo.png" alt="Table 1"></a></p>
  
  <p>That I want to turn into this:</p>
  
  <p><a href="https://i.stack.imgur.com/y28LS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y28LS.png" alt="Table 2"></a></p>
  
  <p>I bet it is a pretty straightforward process but still any help would be appreciated. </p>