Topic 2 Question 1
Suppose you have a table that includes a nested column called "city" inside a column called "person", but when you try to submit the following query in BigQuery, it gives you an error. SELECT person FROM
project1.example.table1WHERE city = "London" How would you correct the error?Add ", UNNEST(person)" before the WHERE clause.
Change "person" to "person.city".
Change "person" to "city.person".
Add ", UNNEST(city)" before the WHERE clause.
解説
To access the person.city column, you need to "UNNEST(person)" and JOIN it to table1 using a comma. Reference: https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacy-sql#nested_repeated_results
ユーザの投票
コメント(17)
It must be B. The qestion is about nest nor repeated. Nested doesn't need unnest, while repeated do. https://cloud.google.com/bigquery/docs/nested-repeated
👍 28norwayping2020/06/29Answer : A
👍 25[Removed]2020/03/21cant believe that most voted is totally wrong. person to person.city is not the issue here.
in order to use nested query in standard SQL, we need to unnest. so Answer is A
👍 15safiyu2021/08/12
シャッフルモード