Transpose rows into columns in MySQL
27,498
You can turn rows into a column with GROUP_CONCAT
, but you can't transpose whole result sets in any automatic way. You either write a query that produces each column manually, or you do it in an application.
Here's a tutorial on writing the complicated queries to emulate the transposition:
http://www.artfulsoftware.com/infotree/queries.php#78
Author by
Even
Updated on July 23, 2022Comments
-
Even almost 2 years
How can I convert rows into columns in a MySQL query?