SELECT customer_id, firstname, surname INTO OUTFILE 'E:/exportdata/customers.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY ' ' FROM customers;