#1055

Active Subscription Order

Step 2: for each active subscription with status = 'active', assign its sequence number within its user_id: the earliest started_at gets 1, and a tie uses the smaller id first. Return id, user_id, and rn, sorted by user_id, then rn.

Kampjun tal-output mistenni

Dan hu kif tidher tweġiba korretta — l-għadd tar-ringieli huwa tiegħu stess, m'għandux għalfejn jaqbel mat-tabelli tal-iskema.

idrnuser_id
30011
30121
30212

Ir-riżultat tal-query tiegħek jidher hawn