tonelm54
asked on
Get columns from query
Is it possible to get a list of columns from a query?
I have a table:-
But I want it to display the contents as:-
I know I could use a query such as:-
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
I have a table:-
But I want it to display the contents as:-
I know I could use a query such as:-
Select DISTINCT `question` FROM `myTable` WHERE `surveyID` = 1;
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER