google-big-queryHow do I use Google BigQuery to unnest an array?
Google BigQuery allows users to unnest an array by using the UNNEST
function. The UNNEST
function takes an array as its input and returns a table with a single row for each element in the array.
For example, the following code block will take the array [1,2,3]
and return a table with three rows, one for each element in the array:
SELECT * FROM UNNEST([1,2,3])
Output example
1
2
3
The code consists of two parts:
- The
UNNEST
function, which takes the array as its input and returns a table with a single row for each element in the array. - The
SELECT
statement, which specifies which columns from the table returned by theUNNEST
function should be included in the output.
For more information on the UNNEST
function, please see the Google BigQuery documentation.
More of Google Big Query
- How can I use Google Big Query to count the number of zeros in a given dataset?
- ¿Cuáles son las ventajas y desventajas de usar Google BigQuery?
- How do I use the YEAR function in Google BigQuery?
- How can I use Google Big Query to process XML data?
- How can I use the CASE WHEN statement in Google Big Query?
- How do I use Google BigQuery language to query data?
- How do I use the "not in" operator in Google BigQuery?
- How do I set up a Google Big Query zone?
- How can I use the Google BigQuery free tier?
- How do I use Google Big Query to zip files?
See more codes...