SQL Interview: 50 Using WHERE vs HAVING
This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.
Section: Developer Level: Intro
Question:
You need to filter rows being returned by a query.
When should you use a HAVING clause rather than a WHERE clause?
Answer:
A WHERE clause is used to filter the rows from the source (usually a table).
2025-05-24