#662

Client spend in the last 30 days

An MTS product analyst pulls a weekly leaderboard of top wallets by spend in the last month — feeds trigger campaigns and upsell offers. Clients are identified by UUIDs from billing; transaction amounts arrive in rubles with kopecks. Compute total spend per client over the last 30 days relative to CURRENT_DATE (today inclusive). The biggest wallets come on top. Skip clients with no transactions in that window. Treat the current moment as 2026-05-05 12:00:00 UTC — every relative-time expression in the seed and the reference solution is anchored to that point.

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.

client_idspend_30d
55555555-5555-5555-5555-0000000001049000.00
11111111-1111-1111-1111-0000000001002300.50
22222222-2222-2222-2222-0000000001012200.00
MTS

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid