In a test at university there was a question; is it possible to use an aggregate function in the SQL WHERE clause.
SQL WHERE
I always thought this isn\'t possibl
HAVING is like WHERE with aggregate functions, or you could use a subquery.
select EmployeeId, sum(amount) from Sales group by Employee having sum(amount) > 20000
Or
select EmployeeId, sum(amount) from Sales group by Employee where EmployeeId in ( select max(EmployeeId) from Employees)