COUNT_BIG
SUM
AVG
Returns the sum.
SUM(expr)
Enter values below to update the example in real time.
customer_id
total_amount
lifetime_value
orders
SELECT customer_id, SUM(total_amount) AS lifetime_value FROM orders GROUP BY customer_id;