如何连接组中的列varchar值?

时间:2018-04-08 14:45:03

标签: sql hadoop hbase hortonworks-data-platform phoenix

我想对一列进行选择,我将值连接起来。例如,如果我有行:

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;

0 个答案:

没有答案