SELECT * FROM (select 'id','url','大分类','分类','贴吧名称','关注用户数','帖子数量','简介','帖子名称','楼主ID',
'发表时间','采集时间','首页body','body1','body2','state','replys' union select id,url,大分类,分类,贴吧名称,关注用户数,帖子数量,简介,帖子名称,楼主ID,发表时间,采集时间,replace (replace (首页body, char(10), ''), char(13), ''),replace (replace (body1, char(10), ''), char(13), ''),replace (replace (IFNULL(body2, 'N/A'), char(10), ''), char(13), ''),state,replys from baidu_088_middle) b INTO OUTFILE '/var/lib/mysql-files/baidu88_b4.csv' FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY ',' ESCAPED BY '"' LINES TERMINATED BY '\r\n' ;
此包含标题,值中有逗号与\r\n度可以有效屏蔽