我想对一列进行选择,我将值连接起来。例如,如果我有行:
ID NAME Friend
1 Joe Fred
2 Jeff Fred
3 Joe Jack
4 Joe Sally
我按名字分组,我会得到:
Joe Fred,Jack,Sally
Jeff Fred
凤凰城有功能吗?
这将是:
SELECT
NAME,
CONCAT( Friend, "," )
FROM People
GROUP BY NAME;