Because the WHERE clause is evaluated before GROUP BY, you cannot use WHERE to pare down results of the grouping (typically an aggregate function, such as COUNT(*)). To meet this need, the HAVING clause can be used.
For example, using the following data:
DECLARE @orders TABLE(OrderID INT, Name NVA...