Problems / String Aggregation / Editorial
STRING_AGG(employee_name, ', ' ORDER BY employee_name) concatenates values with a delimiter. The ORDER BY inside the function controls the order of concatenation.
STRING_AGG(employee_name, ', ' ORDER BY employee_name)
ORDER BY
F.collect_list("employee_name")
F.sort_array(...)
F.concat_ws(", ", ...)
String aggregation is essential for denormalizing data — e.g., showing all tags for a product or all skills for a user in a single row.
Solve String Aggregation yourself →