BigQuery array concatenation to string

Nick Lydon
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

--

--

Nick Lydon

British software developer working as a freelancer in Berlin. Mainly dotnet, but happy to try new things! https://github.com/NickLydon