title: Create temp table with column names from another tables column data
body: <p>Is it possible to create a temp table with columns named with data from a single column in another table for example - </p>
  
  <pre><code>singleColumn
  -data1
  -data2
  -data3
  -data4
  </code></pre>
  
  <p>then from this create a temp table like - </p>
  
  <pre><code>data1 | data2 | data3 | data4
  </code></pre>
  
  <p>edit:</p>
  
  <p>I have a user that can have 0 to whatever demographics from the demographics table. A join will return several rows for a user. I need this data joined on 1 row so I can store this data in CSV file.</p>