ARRAY_AGG(col)
Concatenation of values in a column (including the null value) into an array can be used for multiple rows to one row (row to column).
mysql> select * from test_doris_array_agg; +------+------+ | c1 | c2 | +------+------+ | 1 | a | | 1 | b | | 2 | c | | 2 | NULL | | 3 | NULL | +------+------+ mysql> select c1, array_agg(c2) from test_doris_array_agg group by c1; +------+-----------------+ | c1 | array_agg(`c2`) | +------+-----------------+ | 1 | ["a","b"] | | 2 | [NULL,"c"] | | 3 | [NULL] | +------+-----------------+
ARRAY_AGG