mysql GROUP_CONCAT 函数 将相同的键的多个单元格合并到一个单元格

MemberID          MemberName              FruitName
-------------- --------------------- --------------
1 Al Apple
1 Al Cherry

Desired output

MemberID           MemberName            FruitName
----------- -------------- ------------
1 Al Apple, Cherry
3accepted

GROUP BY MemberName and GROUP_CONCAT(FruitName). For example,

SELECT MemberId, MemberName, GROUP_CONCAT(FruitName) FROM a LEFT JOIN b ON a.MemberName = b.MemberName GROUP BY a.MemberName;
04-25 03:51