You can use both HAVING and WHERE in a single SQL statement. WHERE filters rows before grouping, while HAVING filters groups after aggregation. For example: SELECT category, COUNT() FROM products WHERE price > 10 GROUP BY category HAVING COUNT() > 5 uses both clauses.