Sobes.tech
Intern — Middle

Cleaning the Person table from duplicate email addresses

livecode

Task condition

It is necessary to delete all duplicate email addresses from the Person table, leaving only the record with the smallest id value for each unique address.

Input: +----+-------------------+ | id | email | +----+-------------------+ | 1 | john@example.com | | 2 | bob@example.com | | 3 | john@example.com | +----+-------------------+ Output: +----+-------------------+ | id | email | +----+-------------------+ | 1 | john@example.com | | 2 | bob@example.com | +----+-------------------+