title: How can I generate sql matrix
body: <p>How I can create this matrix from the tables in sql query? I have table which show how many goods was sold. I want show title of goods instead id of goods. But it's important that fields toy1, toy2 and toy3 have datatype decimal(20,8)</p>
  
  <pre><code>Table 1
  
  id   year   toy1   toy2   toy3
  -------------------------------
  -1           1      3      2
   1   2016    100    20     50
   2   2017    150    120    40
  
  Table 2
  
  id     toy
  ---------------
  1      doll
  2      car
  3      bear
  
  Result matrix
  
   id   year   toy1   toy2   toy3
  -------------------------------
  -1           doll   bear   car
   1   2016    100    20     50
   2   2017    150    120    40
  </code></pre>