mediumU Mobile · window
Number each subscriber's reloads in order
Prepaid reloads all land in one table. Marketing wants to know whether a reload was a subscriber's first, second, third and so on, so they can target people who have only ever reloaded once.
Number each subscriber's reloads from oldest to newest, restarting at 1 for every subscriber.
Return msisdn, reload_date, amount and reload_no, ordered by msisdn then reload_date.
Schema
▸reloads
| reload_id | INT |
| msisdn | TEXT |
| reload_date | DATE |
| amount | NUMERIC |
Example input
▸reloads
Stuck? Ask the coach for a nudge that won't give the answer away, or reveal the reference solution and a short walkthrough of why it works.