Created
August 3, 2018 08:28
-
-
Save IdrisDose/92ea969215a23947ad086a76e75e94b3 to your computer and use it in GitHub Desktop.
Quick MySQL fixing duplicate column
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
-- step 1 | |
CREATE TABLE source_temp | |
LIKE source; | |
-- step 2 | |
INSERT INTO source_temp | |
SELECT * | |
FROM source | |
GROUP BY <COLUMN>; | |
-- step 3 | |
DROP TABLE source; | |
ALTER TABLE source_temp | |
RENAME TO source; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment