Link to home
Start Free TrialLog in
Avatar of tonelm54
tonelm54

asked on

Get columns from query

Is it possible to get a list of columns from a query?

I have a table:-
User generated image
But I want it to display the contents as:-
User generated image
I know I could use a query such as:-
Select DISTINCT `question` FROM `myTable` WHERE `surveyID` = 1; 

Open in new window


Then build up the SQL statement to display my table.

I was going to use SQLite but think its not powerful enough to do this, so was thinking of using MySQL.

Any ideas if this is even possible, and if possible how can I do it?

Thank you
ASKER CERTIFIED SOLUTION
Avatar of Tomas Helgi Johannsson
Tomas Helgi Johannsson
Flag of Iceland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tonelm54
tonelm54

ASKER

Need to put it in a query from a database, not as a pivot table
Hi!

If you look at the examples then you will see how this pivot query (executed inside the database)
transforms your data in pivot like manner into the format you are asking for.

Regards,
   Tomas Helgi