如何运行查询,通过我的Android和iOS数据来返回我需要的表格。
当我运行此
时,目前出现上述错误#standardSQL
SELECT
user_dim.app_info.app_instance_id,
user_dim.device_info.device_category,
user_dim.device_info.user_default_language,
user_dim.device_info.platform_version,
user_dim.device_info.device_model,
user_dim.geo_info.country,
user_dim.geo_info.city,
user_dim.app_info.app_version,
user_dim.app_info.app_store,
user_dim.app_info.app_platform
FROM
app.com_aaa_IOS.app_events_20171204
,app.com_aaa_ANDROID.app_events_20171204
答案 0 :(得分:2)
SELECT
user_dim.app_info.app_instance_id,
user_dim.device_info.device_category,
user_dim.device_info.user_default_language,
user_dim.device_info.platform_version,
user_dim.device_info.device_model,
user_dim.geo_info.country,
user_dim.geo_info.city,
user_dim.app_info.app_version,
user_dim.app_info.app_store,
user_dim.app_info.app_platform
FROM
app.com_aaa_IOS.app_events_20171204
UNION ALL
SELECT
user_dim.app_info.app_instance_id,
user_dim.device_info.device_category,
user_dim.device_info.user_default_language,
user_dim.device_info.platform_version,
user_dim.device_info.device_model,
user_dim.geo_info.country,
user_dim.geo_info.city,
user_dim.app_info.app_version,
user_dim.app_info.app_store,
user_dim.app_info.app_platform
FROM
app.com_aaa_ANDROID.app_events_20171204
答案 1 :(得分:1)
标准SQL
您正在使用Standard SQL,那么您应该使用UNION ALL运算符:
SELECT
user_dim.app_info.app_instance_id,
...
FROM app.com_aaa_IOS.app_events_20171204
UNION ALL
SELECT
user_dim.app_info.app_instance_id,
...
FROM app.com_aaa_ANDROID.app_events_20171204`
请记住,您可以使用Wildcard Tables:
SELECT
FROM
`<project-id>.<dataset-id>.<table-prefix>*`
WHERE
bool_expression
旧版SQL
如果您切换到Legacy SQL,那么您可以将逗号分隔的表用作联合,就像在查询中一样。
可以使用逗号查询这些数据源的组合,这是BigQuery中的UNION ALL运算符