0

This topic already explain how to export directly from the command line to standard output while using default output format or how to export with custom format in a file specified in the SQL query.

So basicaly the question can also be phrased as is there a way to specify standard output to "INTO OUTFILE"?

In my case post-treatment of the default output would be quite difficult, as fields seems to contains tabs, so having quotes seems really necessary.

Community
  • 1
  • 1
psychoslave
  • 1,961
  • 2
  • 21
  • 38
  • Not sure I understand what you are asking. Can you have another try at explaining what issue you are trying to solve, maybe an example would help us – RiggsFolly Jul 05 '16 at 08:51

2 Answers2

0

USE CONCATE_WS

 mysql>  SELECT CONCAT_WS(',',TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME) FROM information_schema.COLUMNS WHERE TABLE_NAME="TEST";
    +----------------------------------------------------+
    | CONCAT_WS(',',TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME) |
    +----------------------------------------------------+
    | TESTDB,TEST,user_id                     |
    | TESTDB,TEST,NAME                        |
    | TESTDB,TEST,value                       |
    +----------------------------------------------------+
    3 rows in set (0.00 sec)
Mahesh Madushanka
  • 2,646
  • 1
  • 9
  • 26
0

In MySQL Forums :: Other Migration :: Export to CSV I was able to find a different solution, export csv with both quotes and comma separator. That wasn't really my demand here, but it does enable to achieve what I wanted.

psychoslave
  • 1,961
  • 2
  • 21
  • 38