0
我試圖分析BigQuery中的firebase分析數據。我需要使用StandardSQL更新BigQuery中的表格。BigQuery子查詢高效加入
我必須更新表cart
中的order_flag
,其中key = 'item_id'
通過將其加入到另一個表order
。
下面是查詢:
#standardSQL
UPDATE `dataset.cart` c
SET c.order_flag = true
WHERE (SELECT value.string_value
FROM UNNEST(c.event_dim.params)
WHERE key = 'item_id') IN
(SELECT
(SELECT value.string_value
FROM UNNEST(o.event_dim.params)
WHERE key = 'item_id')
FROM `dataset.order` o
WHERE (SELECT key FROM UNNEST(o.event_dim.params)
WHERE key = 'item_id') =
(SELECT value.string_value FROM UNNEST(c.event_dim.params)
WHERE key = 'item_id'))
但我得到的錯誤:
Error: Correlated subqueries that reference other tables are not supported unless they can be de-correlated, such as by transforming them into an efficient JOIN.
如何做到在這種情況下的有效的連接?