22
12月
2021
加表头导出
select * from (select 'id','用户名称','密码' union all select id,user_name,password from ctrl_user) b into outfile '/public/excel/export/ctrl_user.xlsx' fields terminated by ',' lines terminated by ' ';
不加表头导出
select id,user_name,password from ctrl_user into outfile '/public/excel/export/ctrl_user.xlsx' fields terminated by ',' lines terminated by ' ';
特殊说明,本文版权归 ning个人博客 所有带原创标签请勿转载,转载请注明出处.
本文标题: mysql查询语句导出到excel等文件