SELECT id,name,spec INTO OUTFILE 'd://output2.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM tableName;