【发布时间】:2021-01-29 02:41:01
【问题描述】:
我正在我的数据库中执行一个配置单元查询,我在其中加入 3 个表(表 1、表 2、表 3),然后使用子查询将表 1 年份列与其他 3 个表(表 4、表 5、表 6)进行比较。我正在使用以下查询。
select * from table1 A INNER JOIN table2 B ON A.id =b.id
inner JOIN table3 c ON A.id = c.id
and c.country ="India"
where (A.year)< (select year4 from table4)
and (A.year1)< (select year5 from table5 )
and (A.year1)< (select year5 from table5)
and (A.year1)< (select year6 from table6) limit 10;
但它给了我以下错误:
Error: Error while compiling statement: FAILED: SemanticException Line 0:-1 Unsupported SubQuery Expression
'year1': Only 1 SubQuery expression is supported.
请有人指导我该如何处理。
【问题讨论】:
-
请提供样本数据、期望的结果以及您想要的逻辑解释。仅从这个无效查询中评估您想要做什么并不明显。
-
@GMB,我已经更新了问题。请帮我修改我的查询。
标签: hive