title: How to pivot tables in MySQL
body: <p>I have a question about how to pivot the table in MySQL. 
  I have a dataset, columns like this:</p>
  
  <pre><code>ID   Name     job_title
  1    Sam       Fireman
  2    Tomas     Driver
  3    Peter     Fireman
  4    Lisa      Analyst
  5    Marcus    Postman
  6    Stephan   Analyst
  7    Mary      Research Manager
  8    Albert    Analyst
  9    Chen      Driver
  ...etc...
  </code></pre>
  
  <p>And I want to generate a table like this:</p>
  
  <pre><code>Fireman  Driver   Analyst  Postman   Research Manager ...
  Sam     Tomas     Lisa     Marcus     Mary
  Peter   Chen      Stephan  (someone)  (someone)...
  ....etc...
  </code></pre>
  
  <p>Since, this is just a sample from the datasets, so I may not know how much different job titles in the dataset. The goal is to list every person in the different job title columns. </p>
  
  <p>Is there any methods to do that? Or is it possible to generate such table in MySQL?
  An engineer told me that it can done by creating a view, but I do not know how. I read some books, and still confused. </p>
  
  <p>Any ideas and SQL queries guides are welcome!</p>