I am selecting data from Google Bigquery table which includes JSON column. My table has multiple nested arrays, one of the includes two nested levels. here is my table schema
My statement is:
SELECT
items.*,
pay.*,
credits.creditnoteid,
credits.id,
credits.total
FROM client_account.invoices,
UNNEST(lineitems) items,
UNNEST(items.tracking),
UNNEST(payments) pay,
UNNEST(creditnotes) credits
Unfortunately I get no results... Can you help me to unnest all of the arrays.
items.tracking
? You do not use it in any part of your query. – AlessandroSELECT items.*, tracking.*, pay.*, credits.creditnoteid, credits.id, credits.total FROM client_account.invoices, UNNEST(lineitems) items, UNNEST(items.tracking) tracking, UNNEST(payments) pay, UNNEST(creditnotes) credits
same - no results When I exclude UNNEST(creditnotes) credits and use this statemnt, it worksSELECT items.*, tracking.*, pay.* FROM client_account.invoices, UNNEST(lineitems) items, UNNEST(items.tracking) tracking, UNNEST(payments) pay
– UDO