LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE ‘file_name.txt’
[REPLACE | IGNORE]
INTO TABLE tbl_name
[FIELDS
[TERMINATED BY ‘\t’] – 在字段之间写入制表符
[[OPTIONALLY] ENCLOSED BY ‘’] --不把字段包含在任何引号字符中。如果是ENCLOSED BY “’” :使用单引号把各个字段括起来;
[ESCAPED BY ‘\’ ] --当字段值中出现制表符、新行或‘\’时,使用‘\’进行转义。
]
[LINES
[STARTING BY ‘\n’] – 在行的末端写入新行。
[TERMINATED BY ‘’] --不会跳过任何行前缀。
]
[IGNORE number LINES]
[(col_name_or_user_var,…)]
[SET col_name = expr,…)]
SELECT * INTO outfile ‘e:/tmp/t_aty_corp.sql’ FIELDS TERMINATED BY ‘$’ OPTIONALLY ENCLOSED BY “’” ESCAPED BY ‘\’ LINES STARTING BY ‘\r\n’ TERMINATED BY ‘’ FROM db_aty.t_aty_corp;
‘1100’
′
监
狱
管
理
局
′
'监狱管理局'
′监狱管理局′\N
1
1
1\N$‘监狱管理局’$1
1
1
1’1100’
′
1
′
'1'
′1′\N
′
2011
−
01
−
1200
:
00
:
0
0
′
'2011-01-12 00:00:00'
′2011−01−1200:00:00′
‘1101’
′
第
一
监
狱
′
'第一监狱'
′第一监狱′‘1100’
2
2
2\N$‘第一监狱’$1
2
2
2’1101’
′
1
′
'1'
′1′\N
′
2011
−
01
−
1200
:
00
:
0
0
′
'2011-01-12 00:00:00'
′2011−01−1200:00:00′
‘1102’
′
第
二
监
狱
′
'第二监狱'
′第二监狱′‘1100’
2
2
2\N$‘第二监狱’$1
3
3
3’1102’
′
1
′
'1'
′1′\N
′
2011
−
01
−
1200
:
00
:
0
0
′
'2011-01-12 00:00:00'
′2011−01−1200:00:00′
SELECT * INTO outfile ‘e:/tmp/t_aty_corp.sql’ FIELDS TERMINATED BY ‘$’ OPTIONALLY ENCLOSED BY “^” ESCAPED BY ‘\’ LINES STARTING BY ‘\r\n’ TERMINATED BY ‘’ FROM db_aty.t_aty_corp;
1100KaTeX parse error: Expected group after '^' at position 7: ^监狱管理局^̲\N
1
1
1\N$监狱管理局$1
1
1
11100KaTeX parse error: Double superscript at position 3: ^1^̲\NKaTeX parse error: Expected group after '^' at position 21: …-01-12 00:00:00^̲
1101KaTeX parse error: Expected group after '^' at position 6: ^第一监狱^̲1100
2
2
2\N$第一监狱$1
2
2
21101KaTeX parse error: Double superscript at position 3: ^1^̲\NKaTeX parse error: Expected group after '^' at position 21: …-01-12 00:00:00^̲
1102KaTeX parse error: Expected group after '^' at position 6: ^第二监狱^̲1100
2
2
2\N$第二监狱$1
3
3
31102KaTeX parse error: Double superscript at position 3: ^1^̲\NKaTeX parse error: Expected group after '^' at position 21: …-01-12 00:00:00^̲