Question

In SQL, what is the difference between 'WHERE' and 'HAVING' clauses?

A WHERE filters columns; HAVING filters rows
B WHERE is used with JOIN; HAVING is used with subqueries
C WHERE filters rows before grouping; HAVING filters groups after GROUP BY
D WHERE can use aggregate functions; HAVING cannot
E There is no difference — both filter rows identically
Practice Next

Relevant for Exams:

Hey! Ask a query