Last active
June 26, 2018 13:27
-
-
Save alyjee/257435785e9d6fca3ecfa53295c4402b to your computer and use it in GitHub Desktop.
Some usual/unusual queries for mySql
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
-- Load Data from a text file with comma separated columns | |
LOAD DATA LOCAL INFILE '/path/to/file.txt' INTO TABLE `tableName` | |
FIELDS TERMINATED BY 'x' | |
-- (here x could be comma ',', tab '\t', semicolon ';', space ' ') | |
LINES TERMINATED BY 'y'; | |
-- (here y is a new line character, it can be ¬, \n or anything) sometimes you may need to use only fields teminated by | |
---------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment