SQL - GROUP BY and HAVING
Find the error in this SQL query:
SELECT department, MAX(salary) FROM employees GROUP BY department HAVING salary > 50000;
Find the error in this SQL query:
SELECT department, MAX(salary) FROM employees GROUP BY department HAVING salary > 50000;
HAVING clause filters groups based on aggregate results or grouped columns.salary directly in HAVING, but salary is neither aggregated nor grouped.MAX(salary) > 50000 in HAVING.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions