我正在尝试使用Hive来显示表中的行,该行超过每个唯一工作角色(ROLE)的平均薪水(AnnualSalary)超过10000。 我尝试使用下面的代码无效,并在底部显示错误
hive> SELECT ROLE, AVG(AnnualSalary) From Salaries WHERE AnnualSalary > AVG(AnnualSalary) +10000 GROUP BY ROLE;
失败:SemanticException [错误10128]:行1:66 UDAF'AVG'尚不支持的位置
答案 0 :(得分:0)
SELECT ROLE, AVG(AnnualSalary)
FROM Salaries
GROUP BY ROLE
HAVING AnnualSalary > (AVG(AnnualSalary) + 10000);