Below the table as I have it. I have an alias column with a value. I'm trying to make dynamic columns from the alias. The aliases are dynamic so they can change.
MySQL Join Multiple Rows as Columns here they have 2 tables that they join, I have only one. But still I can't get it to work. I wonder if I really need a prepare statement.
When I use
SELECT GROUP_CONCAT(DISTINCT CONCAT('value AS ', alias))
I'm get that piece of query as column name.
ID value alias
1 aaa test1
1 bbb test2
1 ccc test3
2 ddd test1
2 eee test2
2 fff test3
The desired result right from the MySQL query is:
ID test1 test2 test3
1 aaa bbb ccc
2 ddd eee fff
Does anyone know how to accomplish this?