title: Setting column values as column names in the SQL query result
body: <p>I wanted to read a table which has values which will be the column names of the sql query result.
  For example, I have table1 as ..</p>
  
  <pre><code>id    col1     col2
  ----------------------
  0      name    ax
  0      name2   bx
  0      name3   cx
  1      name    dx
  1      name2   ex
  1      name3   fx                
  </code></pre>
  
  <p>If you see for id = 0, name has value of ax and name2 is bx and name3 is cx.
  Instead of this being rows it would be easier to show columns as id, name, name2, name3.
  Now I want the result of the query to look like this:</p>
  
  <pre><code>id   name    name2     name3
  0    ax      bx         cx
  1    dx      ex         fx
  </code></pre>
  
  <p>Can someone help me in achieving this?</p>