除条件外,蜂巢查询



我正在尝试构建一个仅执行以下功能或这些功能组合的蜂巢查询。例如,功能包括

名称="摘要"

名称="详细信息"

name1 ="车辆统计"

基本上,查询应排除名称和名称1中的所有其他功能。

我是Hive的新手。在SQL中,我知道可以使用关键字除外。只是想知道是否有一些功能可以实现相同的功能。

非常感谢!

如果我正确理解,我使用 group byhaving

对此进行处理。
select ?
from t
group by ?
having sum(case when name = 'summary' then 1 else 0 end) > 0 and
       sum(case when name = 'details' then 1 else 0 end) > 0 and
       sum(case when name1 = 'vehicle_stats' then 1 else 0 end) > 0;

?用于您想要的列。

的摘要

最新更新