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 ' ';

发表评论