[Description]
You are give a table named Person
-
Code:
Select all
[Description] You are give a table named Person Code: Select all +-------------+---------+ | Column Name | Type | +-------------+---------+ | email | varchar | | id | int | +-------------+---------+ id is the primary key column for this table. Write a SQL to delete all the duplicated email records
id is the primary key column for this table.
Write a SQL to delete all the duplicated email records
For example, if the rows are:
For example, if the rows are: +----+-------------+ | 1 | a@gmail.com | | 2 | b@gmail.com | | 3 | a@gmail.com | | 4 | b@gmail.com | +----+-------------+ Does deleting duplicate email records mean deleting all duplicates except the first entry? +----+-------------+ | 1 | a@gmail.com | | 2 | b@gmail.com | +----+-------------+ Or we don't care if the deleted entry is not the first one, such as this is correct too? +----+-------------+ | 3 | a@gmail.com | | 4 | b@gmail.com | +----+-------------+