Use ARRAY_AGG to flatten columns to lists.
You need to convert a long table of values into a list? This is the most convenient function.
π Syntax:
ππ΄π»π΄π²π π°πππ°π_π°πΆπΆ(ππππππ) π΅ππΎπΌ πππππ
There you go, the column is flattened into a list separated by comma.
β To do so, I used to copy the entire column into a spreadsheet tool, transpose it, and use some Excel magic to convert it to a list. And I'll never do it again.
You can use it with GROUP BY and get separate lists! Full example below.