Maximum of averages
问题 I'm supposed to get every departments average wage and only show the department with the highest average wage. I figured out this query, but it doesn't work. Anyone got some ideas? SELECT department, max(avg(wage)) FROM employees GROUP BY department; I get this error: ERROR at line 1: ORA-00937: not a single-group group function 回答1: Without CTEs you can do: Select Z.Department, Z.AvgWage From ( Select Department, Avg(Wage) AvgWage From Employees Group By Department ) As Z Where AvgWage = (