GROUP BY + an aggregate function SELECT customer_id, SUM(amount) FROM table GROUP BY customer_id will group up all repeating rows into one and sum their amounts into one — select the customer_id and take the sum of the amount column from the table grouped by the customer_id some SQL engines need you to select the column you are grouping by

Get

Explore more quotes

Momchil Kolev