Home > OS >  un-struct in big query
un-struct in big query

Time:06-14

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

CodePudding user response:

use below

select 
  consignment id, 
  user.* 
from tbl
  • Related