sql - Why do we need GROUP BY with AGGREGATE FUNCTIONS ...
If you don't specify GROUP BY, aggregate functions operate over all the records selected. In that case, it doesn't make sense to also select a specific column like EmployeeID . Either you want per-employee totals, in which case you select the employee ID and group by employee, or you want a total across the entire table, so you leave out the ...