load data infile 'c:/test.csv'   
into table test [character set utf8]
fields terminated by ','  optionally enclosed by '"' escaped by '"'   
lines terminated by '\r\n';

导出

select * from test 
into outfile 'c:/test.csv'   
fields terminated by ',' optionally enclosed by '"' escaped by '"'   
lines terminated by '\r\n';   

如果要带上字段名用:

select * from (
	select 'col1','col2','col3','col4' union 
	(select col1,col2,col3,col4 from test where col1 = 'xxx' order by col1)
) tbl

相关文章:

  • 2021-11-20
  • 2021-12-07
  • 2021-07-08
  • 2022-12-23
  • 2021-12-26
  • 2021-12-26
  • 2022-01-10
猜你喜欢
  • 2022-12-23
  • 2021-06-10
  • 2021-11-29
  • 2022-01-16
  • 2021-11-20
  • 2021-11-20
相关资源
相似解决方案