196. Delete Duplicate Emails
Last updated
Was this helpful?
Last updated
Was this helpful?
Write a SQL query to delete all duplicate email entries in a table named Person
, keeping only unique emails based on its smallest Id.
Note:
Your output is the whole Person
table after executing your sql. Use delete
statement.
GeeksforGeeks
ProgramCreek
YouTube
Input:
Id
1
john@example.com
2
bob@example.com
3
john@example.com
Id is the primary key column for this table.
Output:
Id
1
john@example.com
2
bob@example.com