简体   繁体   中英

"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." How do I specify that table1.identifier is different from 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         

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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