gpt4 book ai didi

google-bigquery - 大查询 "Where inner select"- 无法加入或联合

转载 作者:行者123 更新时间:2023-12-03 23:03:30 36 4
gpt4 key购买 nike

我得到:

(L1:268): JOIN (including semi-join) and UNION ALL (comma, date range) may not be combined in a single SELECT statement. Either move the UNION ALL to an inner query or the JOIN to an outer query.

查询:
SELECT   a                             AS a, 
Count( DISTINCT b, 999999) AS b,
FROM [dataset.partition_20121216],
[dataset.partition_20130115],
[dataset.partition_20130214]
WHERE created BETWEEN Timestamp('2013-01-05 00:00:00') AND Timestamp ('2013-02-15 23:59:59.999999')
AND id IN (
SELECT id
FROM [dataset.partition_20121216],
[dataset.partition_20130115],
[dataset.partition_20130214]
WHERE created BETWEEN Timestamp('2013-01-05 00:00:00') AND Timestamp ('2013-02-15 23:59:59.999999')
AND name = 'G’
)
GROUP each a
ORDER BY a

我做错了什么?

谢谢。

最佳答案

这是 BigQuery SQL 语法的限制,我将其更改为

SELECT   a                             AS a, 
Count( DISTINCT b, 999999) AS b,
FROM
(SELECT * FROM
[dataset.partition_20121216],
[dataset.partition_20130115],
[dataset.partition_20130214])
WHERE created BETWEEN Timestamp('2013-01-05 00:00:00') AND Timestamp ('2013-02-15 23:59:59.999999')
AND id IN (
SELECT id
FROM [dataset.partition_20121216],
[dataset.partition_20130115],
[dataset.partition_20130214]
WHERE created BETWEEN Timestamp('2013-01-05 00:00:00') AND Timestamp ('2013-02-15 23:59:59.999999')
AND name = 'G’
)
GROUP each a
ORDER BY a

关于google-bigquery - 大查询 "Where inner select"- 无法加入或联合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29947929/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com