Skip to content
RED SAGSkills
easy5 pts · first answer countssqlaggregation

Filtering groups with HAVING

orders has rows (customer_id, amount): (1,10), (1,20), (2,5), (3,40), (3,60), (3,1). What does this query return?

SELECT customer_id, SUM(amount)
FROM orders
GROUP BY customer_id
HAVING COUNT(*) > 1
ORDER BY customer_id;
Choose one answer