PostgreSQL
PostgreSQL HAVING
Filter groups after PostgreSQL calculates aggregates.
Use HAVING
SELECT year, COUNT(*) AS product_count
FROM products
GROUP BY year
HAVING COUNT(*) > 1;Use WHERE to filter individual rows before grouping. Use HAVING to filter the grouped results.