MySQL Forums
Forum List  »  Other Migration

Re: Export to CSV
Posted by: Mike Hillyer
Date: January 26, 2005 09:25PM

All you need is to do the following:

SELECT a,b,a+b INTO OUTFILE '/tmp/result.text'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM test_table;

And the results are sent to /tmp/result.text in CSV format.

Mike Hillyer, Technical Writer
MySQL AB, www.mysql.com
Office: +1 403-380-6535
Mobile: +1 403-330-0870
Blog: http://www.openwin.org/mike

Options: ReplyQuote


Subject
Views
Written By
Posted
181448
January 12, 2005 03:34PM
Re: Export to CSV
107457
January 26, 2005 09:25PM
59813
February 06, 2005 09:15AM
62556
April 12, 2008 12:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.