MySQL export into outfile : CSV escaping chars

前端 未结 6 1937
暗喜
暗喜 2020-11-27 13:44

I\'ve a database table of timesheets with some common feilds.

id, client_id, project_id, task_id, description, time, date 

There are more b

6条回答
  •  春和景丽
    2020-11-27 14:25

    Probably won't help but you could try creating a CSV table with that content:

    DROP TABLE IF EXISTS foo_export;
    CREATE TABLE foo_export LIKE foo;
    ALTER TABLE foo_export ENGINE=CSV;
    INSERT INTO foo_export SELECT id, 
       client,
       project,
       task,
       REPLACE(REPLACE(ifnull(ts.description,''),'\n',' '),'\r',' ') AS description, 
       time,
       date
      FROM ....
    

提交回复
热议问题