It is very easy to remove values that you don't want aggregated.

For instance:

```
SELECT department, SUM(sales) as "Total sales"
FROM order_details
GROUP BY department
HAVING SUM(sales) > 1000;

```

Which will exclude all sales with a value less than or equal to 1000 from the summing aggregation.

But how do you filter after the aggregation?

E.g. `WHERE ("Total sales"> 15000)`

Edit: Ironically I was only including `HAVING SUM(sales) > 1000;` in order to prevent confusion about the type of query required; because I'm not actually interested in excluding items from the summing, just the returned results! Thanks, despite confusion!