Skip to content

Instantly share code, notes, and snippets.

@iplotin
Forked from p0vidl0/drop_duplicates.sql
Created July 26, 2021 11:48
Show Gist options
  • Select an option

  • Save iplotin/2bbbc8339b844c2252c588aa22896be3 to your computer and use it in GitHub Desktop.

Select an option

Save iplotin/2bbbc8339b844c2252c588aa22896be3 to your computer and use it in GitHub Desktop.
Delete all duplicate rows based on the email field
DELETE c1 FROM `clients` c1, `clients` c2 WHERE c1.`id` < c2.`id` AND c1.`email` = c2.`email`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment