#1091

Revenue for Every User

The product mart must show revenue for every user from a_users. Sum amount from a_events only for kind = 'purchase'; if there are no purchases, show 0. Return id and revenue, sorted by id.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.

idrevenue
150
20
350

Your query result will appear here