Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save akinozgen/2821fef804a52370efc84393aac77dc0 to your computer and use it in GitHub Desktop.
Save akinozgen/2821fef804a52370efc84393aac77dc0 to your computer and use it in GitHub Desktop.
Mysql - Remove duplicates by adding a unique key.
-- Reference: https://stackoverflow.com/questions/36647058/removing-duplicates-with-unique-index
ALTER IGNORE TABLE mytable ADD UNIQUE INDEX myindex (A, B, C, D);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment