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; 

Share

Posted in MySQL

You can also read...

Leave a Reply

Your email address will not be published.