两个表上的BigQuery JOIN

时间:2012-09-18 10:21:39

标签: google-bigquery

我正在尝试运行以下查询,但继续遇到相同的错误

  

查询失败   错误:在第6行第33列遇到“”。期待以下之一:

查询是:

  

SELECT 1_0_MEMBER_GROUP.User_Group,   
1_0_MEMBER_GROUP.Member_ID,   
1_4_MEMBER_TRAN_YEAR.MEMBER_UID   
FROM [Dataset1.1_0_MEMBER_GROUP]   
加入[数据集1.1_4_MEMBER_TRAN_YEAR]   
ON 1_0_MEMBER_GROUP.Member_ID = 1_4_MEMBER_TRAN_YEAR.MEMBER_UID

我无法理解为什么它不能运行,而且必须看起来非常简单。

1 个答案:

答案 0 :(得分:13)

您应该使用表别名。试试

SELECT member_group.User_Group, 
member_group.Member_ID, 
member_tran_year.MEMBER_UID 
FROM [Dataset1.1_0_MEMBER_GROUP] as member_group
JOIN [Dataset1.1_4_MEMBER_TRAN_YEAR] as member_tran_year
ON member_group.Member_ID = member_tran_year.MEMBER_UID