Mysql query deleimiter in a file
In the following query if desc has "\" in it and this file when opened by openoffice the \ and appears in a different coulmn.This also happens with city column,How to recitfy this..
select first_name, last_name, emp_id,desc,city from emp_table where event_id = 4 order by 开发者_C百科city asc into OUTFILE "/tmp/Sep10-1.csv" FIELDS TERMINATED BY ",";
Add ESCAPED BY
clause to escape special characters in dump.
select
first_name, last_name, emp_id,desc,city
from
emp_table
where
event_id = 4
order by
city asc
into OUTFILE
"/tmp/Sep10-1.csv"
FIELDS
TERMINATED BY ","
ESCAPED BY "\";
精彩评论