Created
February 17, 2015 13:56
-
-
Save pgtwitter/e8a45485a85df33b6cb0 to your computer and use it in GitHub Desktop.
This file contains 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
DROP TABLE IF EXISTS temp_table, drop_table; | |
CREATE TABLE temp_table LIKE target_table; | |
LOAD DATA INFILE "/path/to/csvfile.csv" INTO TABLE temp_table | |
FIELDS TERMINATED BY ',' ENCLOSED BY '"' | |
LINES STARTING BY '' TERMINATED BY '\n'; | |
RENAME TABLE target_table to drop_table, temp_table to target_table; | |
DROP TABLE drop_table; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment