1SELECT
2 column1,
3 aggregate_function (column2)
4FROM
5 table_name
6GROUP BY
7 column1
8HAVING
9 condition;
1SELECT
2 customer_id,
3 SUM (amount)
4FROM
5 payment
6GROUP BY
7 customer_id
8HAVING
9 SUM (amount) > 200;Code language: SQL (Structured Query Language) (sql)