After a migration there are duplicates — keep the freshest
After a migration users ended up with duplicates: several rows per email.
Keep only the freshest user (the one with the latest creation date), drop the rest. Hint: if you number rows within each email by descending creation date, the freshest row gets number one and the rest get larger numbers — those are the ones to delete.
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.
| name | |
|---|---|
| Alice new | a@example.com |
| Bob | b@example.com |
| Carol3 | c@example.com |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in