I have a JSON column in bigquery as such
SELECT PARSE_JSON('{"a": [1,2,3], "b":[4,5,6]}') AS key_values;
Is it possible to write a query such that I can get the following?
I can have any number of keys so I cannot specify the key name in my query.
Seems like this should be really simple but I cannot figure it out 🙁
2
Answers
You can use
UNNEST
operator along withCROSS JOIN
s to have flattened result such asDemo
you can consider below.
Query results