简体   繁体   English

配置单元查询以从表中删除最小值

[英]hive query to remove minimum values from a table

I have a table with schema t( a ,b,c) in hive. 我在蜂巢中有一个架构为t( a ,b,c)的表。 I have to select all the rows whose a is not the minimum in t 我必须选择a不是t中最小值的所有行

I tried 我试过了

select * from t where a>(select min(a) from t limit 1);

select * from t where t.a not in (select min(a) from t limit 1);

both of them failed .. How can I achieve this in hive and what is the generalization of error in above statements? 他们都失败了..我怎样才能在蜂巢中做到这一点,以及上述陈述中的错误一般化是什么?

Edit : with , IN , exists are not supported in my hive version .. so please refrain from using these in your answer 编辑:在我的蜂巢版本中不支持with , IN , exists ..因此请不要在回答中使用它们

try the below query 试试下面的查询

select A.* from t A left join (select min(a) as min from t) B where Aa>B.min 从t A左连接中选择A。*(从t中选择min(a)作为min)B其中Aa> B.min

Subqueries inside a WHERE clause are not supported in Hive Hive不支持WHERE子句中的子查询

check this Write a nested select statement with a where clause in Hive 检查此内容在Hive中使用where子句编写嵌套的select语句

i think the new version supports subqueries 我认为新版本支持子查询

Thanks 谢谢

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

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