title: how to transpose the table in Mysql
body: <p>How to convert columns and primary rows??</p>
  
  <p>tbl1</p>
  
  <pre><code>     |   p1   |   p2   |   p3   | ...
  g1   |    1   |   2    |    3   | ...
  g2   |    4   |   5    |    6   | ...
  g3   |    7   |   8    |    9   | ...
  </code></pre>
  
  <p>expected result</p>
  
  <pre><code>     |   g1   |   g2   |   g3   | ...
  p1   |    1   |   4    |    7   | ...
  p2   |    2   |   5    |    8   | ...
  p3   |    3   |   6    |    9   | ...     
  </code></pre>
  
  <p>how to make expected result table with tbl1</p>