Search code examples
sqlgoogle-bigquery

Possible to refer to a field in an anonymous struct


Is there a way to refer to what is _field_1 in this anonymous struct/ row type?

select (1,2) a

enter image description here

Trying to do:

select a._field_1 from (select (1,2) a)

Gives an error:

enter image description here


Solution

  • select a[0] from (select (1,2) a)