Menu Close

How to display all the column values in a single row separated by comma in MySQL?

Codeamend

We can get the column values in single row by , using GROUP_CONCAT() and CONCAT() methods. Check the below queries for reference.

Sample Code

select group_concat(concat('[',id,']')) AS ids  from table_name; 
Posted in MySQL

You can also read...