I’m looking to take a String-Array field in Google SQL and transpose it to show all in one column. From there I can take all unique/distinct items from it.
the image above is a sample of what I am trying
I can’t get the string array to split out into resulting rows.
Any help or suggestions would be greatly appreciated
Advertisement
Answer
I think you can do it using unnest
, assuming columnB is holding the array:
select numbers from yourtable t cross join unnest(t.ColumnB) numbers
and for distinct :
select distinct numbers from yourtable t cross join unnest(t.ColumnB) numbers