title: create dynamically created columns from a table in mysql
body: <p>i would like to create virtual columns that are dynamic where the values are being generated based on a join table.</p>
  
  <p>i have the following table called types:</p>
  
  <pre><code>id, name
  1, TypeA
  2, TypeB
  </code></pre>
  
  <p>and i have a table called category</p>
  
  <pre><code>id, name, type
  1, a, 1
  2, b, 2
  </code></pre>
  
  <p>i would like to have a query that returns the following</p>
  
  <pre><code>category name, TypeA, TypeB
  a, 1, 0
  b, 0, 1
  </code></pre>
  
  <p>is this possible to do in mysql?</p>