Thursday, 2 August 2012

MySQL to CSV quick one-liner

MySQL to CSV quick one-liner syntax example:

SELECT * INTO OUTFILE '/tmp/result1.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' FROM USERS WHERE USERNAME LIKE 'A%';

No comments:

Post a Comment