Is it possible to create a temp table with columns named with data from a single column in another table for example -
singleColumn
-data1
-data2
-data3
-data4
then from this create a temp table like -
data1 | data2 | data3 | data4
edit:
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.