MYSQL Export Table to File CSV

Submitted by:J Kamy81

Date added:22 February, 2018

Category:MySQL

MySQL Code Snippets to Export Table to File CSV

Tags: export table , csv

Code Snippet:

SELECT orderNumber, status, orderDate, requiredDate, comments 
FROM orders
WHERE status = 'Cancelled'
INTO OUTFILE 'C:/tmp/cancelled_orders.csv'
FIELDS ENCLOSED BY '"' TERMINATED BY ';' ESCAPED BY '"'
LINES TERMINATED BY '\r\n';
 
 

Comments