BigQuery How to return the first value of array?
In BigQuery, an array is an ordered list consisting of zero or more values of the same data type. You can construct arrays of simple data types, such as INT64, and complex data types, such as STRUCTs. The current exception to this is the ARRAY data type: arrays of arrays are not supported.
\n\nHow can I select the first value of array with BigQuery Standard SQL?
\n\nYou can use either OFFSET()
or ORDINAL()
. The method would be:
select array[offset(0)]\n
\n\nor
\n\nselect array[ordinal(1)]\n
Ryan-Dallas
posted onEnjoy great content like this and a lot more !
Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds
Post Comment