How can I convert rows into columns in a MySQL query?
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.
GROUP_CONCAT
Here's a tutorial on writing the complicated queries to emulate the transposition:
http://www.artfulsoftware.com/infotree/queries.php#78
2.1m questions
2.1m answers
60 comments
57.0k users