Ask the MYSQL database under the SQL how to write statement

ID name
1 Zhang San
1 Li Si
1 Wang Wu
2 1
2 2
2 3

The results you want

1 pieces of three, Li Si, Wang Wu
2 1,2,3

Online can be used on the node with

Started by Josie at February 07, 2016 - 10:13 PM

select group_concat(name) from tt group by id

Posted by Kyle at December 23, 2016 - 7:40 PM

select group_concat(name) from table group by ID
Use the group_concat function

Posted by Teresa at December 30, 2016 - 8:32 PM

select id,group_concat(name) from tt group by id

Posted by Ed at January 09, 2017 - 9:43 PM

select id,group_concat(name)
from tb
group by id;

Posted by Kathie at January 10, 2017 - 9:49 PM

select ID,GROUP_CONCAT(name)
from table1
group by ID;

Posted by Ogden at January 14, 2017 - 9:17 PM