function Syntax:
Group_concat ([DISTINCT] field to connect [Order by sort field Asc/desc] [SEPARATOR ' delimiter '])
The following examples illustrate:
SELECT * from goods;
Group by ID, print the value of the Price field in the same line, Comma separated (default)
Select ID, Group_concat (price) from the goods group by ID;
Group by ID, print the value of the Price field on one line, split the dividend
SELECT ID, group_concat (price separator '; ') from the goods group by ID;
Group by ID, print the value of the Price field that removes redundant redundancy in one line, separated by commas
Select ID, group_concat (distinct price) from the goods group by ID;
Group by ID, print the value of the Price field on one line, comma separated, in reverse order of price
Select Id,group_concat (Price ORDER BY price DESC) from the goods group by ID;
A detailed description of MySQL's Group_concat function