#1056

Subscriptions to Close

Step 3: for each user, keep the earliest active subscription with status = 'active' and mark all later active subscriptions as extras to close. Return the id values of those extra subscriptions, sorted by id.

Esempio di output atteso

Ecco come appare una risposta corretta — il suo numero di righe è a sé stante, non deve corrispondere alle tabelle dello schema.

id
301

Il risultato della tua query apparirà qui