我有下表:
column0 column1 column2 column3 column4
sunny hot high false no
sunny hot high true no
overcast hot high false yes
rainy mild high false yes
rainy cool normal false yes
rainy cool normal true no
我想用having子句和over partition by运行查询,我的查询是
SELECT column0,column1,column2,count(column0) OVER (PARTITION BY column2) AS cnt FROM FF_weatherdatase1 where column0="sunny" having cnt>8
但Hive显示:
HAVING specified without GROUP BY error.
请提供运行having子句的方法,使用over partition by condition而不是group by condition,谢谢。
1条答案
按热度按时间mi7gmzs61#
HAVING
只能用于GROUP BY
. 对于您的查询,可以使用where
括号外的条件。