Created
May 11, 2013 16:54
-
-
Save davidbehan/5560590 to your computer and use it in GitHub Desktop.
Some SQL commands I use every now and then, in current state or modified versions
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
# SQL Like Usage | |
# - - - - - - - - - - - - - - - - - - - - - - - - - - | |
SELECT * FROM asdf WHERE asdf LIKE 'asdf%'; | |
UPDATE asdf | |
SET asdf = "" | |
WHERE asdf LIKE '/images/uploads/asdf%'; | |
UPDATE asdf | |
SET asdf = replace(asdf,'/images/uploads/logos/cropped/ready/','/images/uploads/logos/') | |
WHERE asdf LIKE '/images/uploads/logos/cropped/ready/%'; | |
# import SQL file into table | |
# - - - - - - - - - - - - - - - - - - - - - - - - - - | |
LOAD DATA | |
INFILE '~/Desktop/csv.txt' | |
INTO TABLE asdf | |
COLUMNS TERMINATED BY ',' | |
LINES TERMINATED BY '\n'; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment