Total revenue per user

Total revenue per user

In sales(id, user_id, product, amount, ts) compute the total purchase amount for each user. Group rows by user_id and return columns user_id and total_amount (sum of amount). Order the result by user_id ascending.

Expected output sample

user_idtotal_amount
10425.00
201410.00
PostgreSQLv16

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid