Given a query like below to log the results to a text file
select id from accounts where deleted=1;
try using the command below to output the result to file to ‘C:\test.txt’
select id from accounts where deleted=1 into outfile 'C:\\test.txt';
try using the command below to output the reuslt to csv
select id from accounts where deleted=1 INTO OUTFILE 'C:\\test.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
Related Articles
- SQL Group By Statement: Explanation & Examples (brighthub.com)
- The story of one MySQL Upgrade (mysqlperformanceblog.com)
- Amazon Scales MySQL for Heavy Traffic (java.sys-con.com)
- SQL Replace Function: Explanation & Examples (brighthub.com)
- http://dumptruck.rubyforge.org/svn/README (dumptruck.rubyforge.org)
- DBF Viewer 2000 v3.45: View and Edit DBF Files with a Really Fast Tool (prweb.com)
- Blind SQL Injector Tool (acunetix.com)
- Tips For Logging Your Own Statistics (readwriteweb.com)
- pgedit.com | Power Tools for PostgreSQL (pgedit.com)
- AWS Management Console Support for DB Engine Version Management (aws.typepad.com)
- Export MYSQL To Text File (edugeek.net)
- ARel 2.0: Active Record in Rails 3.0.2 (engineering.attinteractive.com)
- Using ioprofile with MySQL is cool ! (serge.frezefond.free.fr)
- JQuery 1.4.3 and jQuery Mobile Expected on October 16th (css.dzone.com)