clickhouse merges a certain column of data into an array

Method (without deduplication): groupArray

Method (duplication removal): groupUniqArray

usage:

SELECT 分组列,groupArray(合并列——字符串类型)
from1
group by 分组列;

result:

raw data:

Aggregated data results:

If you want to flatten the array into a string, use arrayStringConcat(string, delimiter)

usage:

SELECT arrayStringConcat(['4','5','6'],',');

result:

おすすめ

転載: blog.csdn.net/qq_41110377/article/details/128862623