Skip to content
Advertisement

Standard SQL (Bigquery) Deduplicate comma-separated lists

I have a BigQuery table col with values like

and I want to aggregate it to say "d,b,c" and preferably sort it alphabetically to "b,c,d".

Any idease please? Thanks!

Advertisement

Answer

You would use split():

That said, I would recommend that you use arrays instead of strings for storing such values.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement