Created
February 4, 2014 17:21
-
-
Save bradhe/8808266 to your computer and use it in GitHub Desktop.
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 first_table ( | |
col0 DATETIME NOT NULL, | |
col1 VARCHAR(255) NOT NULL, | |
col2 INT(11) NOT NULL, | |
col3 INT(11) NOT NULL, | |
UNIQUE KEY (col0, col1, col2) | |
) ENGINE=InnoDB; | |
INSERT INTO first_table (col0, col1, col2, col3) VALUES ("2013-01-05 12:00:00", "Hello", 1, 10), ("2013-01-05 12:00:00", "World", 2, 11); | |
CREATE TABLE second_table ( | |
col0 DATETIME NOT NULL, | |
col1 VARCHAR(255) NOT NULL, | |
col2 INT(11) NOT NULL, | |
col3 INT(11) NOT NULL, | |
PRIMARY KEY (col0, col1, col2) | |
) ENGINE=InnoDB; | |
INSERT INTO second_table (col0, col1, col2, col3) SELECT col0, col1, col2, col3 FROM first_table; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment