0

I have a MySQL table of three columns:

id   | name    | value
-------------------------
 1   | name1   | true
 2   | name2   | 3
 ... | ...     | ...
 100 | name100 | foo

There is no repeats in name column.

How can I build a Select query in MySQL, to have the second column as column names, and third column as a row:

 name1 | name2 |  ...  | name100
----------------------------------
 true  |   3   |  ...  |   foo
  • Possible duplicate of [MySQL - Rows to Columns](https://stackoverflow.com/questions/1241178/mysql-rows-to-columns) – mathiasfk Dec 06 '18 at 17:28
  • Please check the similar question related to your query : https://stackoverflow.com/questions/15931607/convert-rows-to-columns-using-pivot-in-sql-server – Ranbir Singh Dec 06 '18 at 17:43

0 Answers0