title: SQL to create matrix table
body: <p>I want to make a view in MySQL that will be generated from 3 tables.</p>
  
  <p>Please see the following tables.</p>
  
  <p>All I want to do is to create a view, using col:name of table:ItemList as the labels of the columns of the new view.</p>
  
  <p>How can I achieve this using SQL?</p>
  
  <p><strong>table: ItemList</strong> ,this changes so frequently</p>
  
  <pre><code>+----+-------------+
  | id | name        |
  +----+-------------+
  |  1 | Apple       |
  |  2 | Orange      |
  |  3 | Banana      |
  |  4 | Kiwi        |
  |  5 | Mango       |
  +----+-------------+
  </code></pre>
  
  <p><strong>table: UserList</strong></p>
  
  <pre><code>+----+-------------+
  | id | name        |
  +----+-------------+
  |  1 | John        |
  |  2 | Mary        |
  |  3 | James       |
  +----+-------------+
  </code></pre>
  
  <p><strong>table: OrderList</strong></p>
  
  <pre><code>+----+------+------+-----+
  | id | User | Item | qty |
  +----+------+------+-----+
  |  1 |    1 |    4 |   1 |
  |  2 |    1 |    2 |   2 |
  |  3 |    2 |    1 |   4 |
  |  4 |    1 |    3 |   3 |
  |  5 |    3 |    5 |   1 |
  |  6 |    2 |    2 |   2 |
  +----+------+------+-----+
  </code></pre>
  
  <p><strong>view</strong> that I want to create</p>
  
  <pre><code>+-------+-------+--------+--------+------+-------+
  | User  | Apple | Orange | Banana | Kiwi | Mango |
  +-------+-------+--------+--------+------+-------+
  | John  |       |      2 |      3 |    1 |       |
  | Mary  |     4 |      2 |        |      |       |
  | James |       |        |        |      |     1 |
  +-------+-------+--------+--------+------+-------+
  </code></pre>