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;
标签:sel mysql down mysq use com name err ext
mysql GROUP_CONCAT 函数 将相同的键的多个单元格合并到一个单元格
MemberID MemberName FruitName
-------------- --------------------- --------------
1 Al Apple
1 Al Cherry
Desired output
MemberID MemberName FruitName ----------- -------------- ------------ 1 Al Apple, Cherry
3down voteaccepted
|
GROUP BY MemberName and GROUP_CONCAT(FruitName). For example,
|
mysql GROUP_CONCAT 函数 将相同的键的多个单元格合并到一个单元格
标签:sel mysql down mysq use com name err ext
原文地址:http://www.cnblogs.com/micro-chen/p/6517866.html