Menu
CoddyTech

Channel Revenue Trends

Part of the Connected Data section of Coddy's PostgreSQL journey. Lesson 24 of 25.

challenge icon

Challenge

Hard

For paid orders only, return channel, order_id, amount and channel_running_total. Extract channel from JSONB; accumulate amounts separately by channel in order date then id order. Use an explicit ROWS frame. Display by channel then order date then id.

The input tables are shown in the test panel. Each run starts from fresh data. Return the named columns in the stated order; do not hard-code the displayed rows.

Try it yourself

-- Write your SQL here.

All lessons in Connected Data

Practice on your own: PostgreSQL playground