Created
December 6, 2013 16:34
-
-
Save perminder-klair/7827832 to your computer and use it in GitHub Desktop.
Duplicate row
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 TEMPORARY TABLE tmptable_1 SELECT * FROM your_table WHERE primarykey = '1'; | |
UPDATE tmptable_1 SET primarykey = NULL; | |
INSERT INTO your_table SELECT * FROM tmptable_1; | |
DROP TEMPORARY TABLE IF EXISTS tmptable_1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment