Created
February 25, 2020 05:19
-
-
Save bfintal/65b079c67a888836217244446df466f4 to your computer and use it in GitHub Desktop.
Remove duplicate entries in MySQL table when you have no unique IDs. Change `mytable` to the name of your table.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `temp` like `mytable`; | |
INSERT `temp` SELECT DISTINCT * FROM `mytable`; | |
DROP TABLE `mytable`; | |
ALTER TABLE `temp` RENAME `mytable`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment