56,675
社区成员
发帖
与我相关
我的任务
分享
版主,我目前看书阅读到存储过程这里, 觉得很是迷惑, 几乎没法理解存储过程是干什么用的,这个貌似和之前学的命令行有很大区别, 就卡在这个存储过程上几天了, 我想成为一位数据库方面维护方面的人员 看各个招聘资历要求都需要具有“熟悉mysql存储过程,能编制复杂的存储过程的能力。” 所以如果过不了存储过程这个坎,我觉学mysql和Excel没啥区别。 望指教~~~
To read a file containing jokes that are separated by lines consisting of %%, you can do this CREATE TABLE jokes (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, joke TEXT NOT NULL); LOAD DATA INFILE '/tmp/jokes.txt' INTO TABLE jokes FIELDS TERMINATED BY '' LINES TERMINATED BY '\n%%\n' (joke); FIELDS [OPTIONALLY] ENCLOSED BY controls quoting of fields. For output (SELECT ... INTO OUTFILE), if you omit the word OPTIONALLY, all fields are enclosed by the ENCLOSED BY character. An example of such output (using a comma as the field delimiter) is shown here: "1","a string","100.20" "2","a string containing a , comma","102.20" "3","a string containing a \" quote","102.20" "4","a string containing a \", quote and comma","102.20" If you specify OPTIONALLY, the ENCLOSED BY character is used only to enclose values from columns that have a string data type (such as CHAR, BINARY, TEXT, or ENUM): 1,"a string",100.20 2,"a string containing a , comma",102.20 3,"a string containing a \" quote",102.20 4,"a string containing a \", quote and comma",102.20
load data infile