Marc
Marc

Reputation: 601

un-struct in big query

I have a table with some struct data types that I can access but would like it as columns.

select 
  consignment id, 
  user 
from tbl

What I currently have

enter image description here

select 
  consignment id
  , user.name
  , user.email
  , user.externalId 
from tbl

What I want

enter image description here

I was able to get it by just calling every key of user but on a table with hundreds of columns that would be terrible

Upvotes: 0

Views: 385

Answers (1)

Mikhail Berlyant
Mikhail Berlyant

Reputation: 172993

use below

select 
  consignment id, 
  user.* 
from tbl

Upvotes: 1

Related Questions