导入
sql
'c:/test.csv'
load data infile set utf8]
into table test [character ',' optionally enclosed by '"' escaped by '"'
fields terminated by '\r\n';
lines terminated by
导出
sql
select * from test
'c:/test.csv'
into outfile ',' optionally enclosed by '"' escaped by '"'
fields terminated by '\r\n';
lines terminated by
如果要带上字段名用:
sql
select * from (
select 'col1','col2','col3','col4' union
select col1,col2,col3,col4 from test where col1 = 'xxx' order by col1)
(
) tbl