SemanticException Column xx Found in more than One Tables/Subqueries

简介:

执行hiveql时报错:

SemanticException Column xx Found in more than One Tables/Subqueries

Hive中有两张表中拥有同一个字段名称,在这两个表做关联的时候会报这个错误

wKiom1WTxLXQIvhZAAEdNs4Yeus194.jpg







将其中一个表的重复字段加上别名,然后进行关联查询

select city.city, hotel.hotel, hotel.hotelname from city city, 

(select city as hcity  ,hotel , hotelname from hotel) hotel

where city.city = hotel.hcity







     本文转自巧克力黒 51CTO博客,原文链接:http://blog.51cto.com/10120275/1669859,如需转载请自行联系原作者

相关文章
|
6月前
|
存储 索引
mysqldump got error 1812 tablespace is missing for table when using lock tables
mysqldump got error 1812 tablespace is missing for table when using lock tables
242 1
|
12月前
|
数据库
解决which is not functionally dependent on columns in GROUP BY clause;...sql_mode=only_full_group_by
解决which is not functionally dependent on columns in GROUP BY clause;...sql_mode=only_full_group_by
254 0
|
关系型数据库 MySQL 数据库
View ‘information_schema.SCHEMATA‘ references invalid table(s) or column(s) or function(s) or define
View ‘information_schema.SCHEMATA‘ references invalid table(s) or column(s) or function(s) or define
222 0
|
SQL 存储 关系型数据库
MySQL中count(*)和information_schema.tables中的table_rows值不相同
MySQL中count(*)和information_schema.tables中的table_rows值不相同
380 0
|
关系型数据库 MySQL 数据库
MySQL - Column 'id' in where clause is ambiguous
MySQL - Column 'id' in where clause is ambiguous
904 0