Hive SQL Distinct Column Syntax Error when calling multiple columns
First, none of your queries have a FROM
clause, so all should generate syntax errors.
More importantly, the SELECT
and GROUP BY
lists should match -- all unaggregated columns should be in the GROUP BY
:
SELECT EmployeeName, SalesID, COUNT(DISTINCT workload) as CasesFROM tGROUP BY EmployeeName SalesID