Postgres ayant
SELECT
customer_id,
SUM (amount)
FROM
payment
GROUP BY
customer_id
HAVING
SUM (amount) > 200;Code language: SQL (Structured Query Language) (sql)
Obedient Osprey