BigQuery array concatenation to string
Mar 30, 2023
I often need to turn an array of numbers in BigQuery to a comma-separated string, but keep forgetting how to so I’m writing it down once and for all!
SELECT ARRAY_TO_STRING(ARRAY(SELECT CAST(n AS STRING) FROM table.Numbers n), ',')
FROM `project.some_table` table