简体   繁体   English

AWS Athena 中的“列名‘标识符’指定了不止一次”

[英]"Column name 'identifier' specified more than once" in AWS Athena

When I try to create a view from a query in AWS Athena, I get error messages like "Column name 'identifier' specified more than once."当我尝试从 AWS Athena 中的查询创建视图时,我收到错误消息,例如“多次指定列名‘标识符’”。 How do I specify that table1.identifier is different from table3.identifier?如何指定 table1.identifier 与 table3.identifier 不同?

This query will run but gives an error when I try to create a view from it:此查询将运行,但当我尝试从中创建视图时会出现错误:

SELECT 
table1.name, 
table1.identifier, 
table2.question_instructions, 
table2.value, 
table3.identifier, 
table2.date         

FROM "table1"

JOIN table4 ON table1.id = table4.instrument_id
JOIN table2 ON table4.id = table2.question_id
JOIN table3 ON table2.user_id = table3.user_id

WHERE question_id = 'b194424f7fdd41ae9';

You need to give them different names.你需要给他们不同的名字。 For example:例如:

SELECT 
table1.name, 
table1.identifier, 
table2.question_instructions, 
table2.value, 
table3.identifier table3_identifier_alias, -- or use any other appropriate
table2.date         

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM