Skip to content

Instantly share code, notes, and snippets.

@alvarow
Created November 17, 2017 15:49
Show Gist options
  • Save alvarow/0e49b48c3d9d879699c44a57732c4256 to your computer and use it in GitHub Desktop.
Save alvarow/0e49b48c3d9d879699c44a57732c4256 to your computer and use it in GitHub Desktop.
MySQL SELECT into a CSV file
SELECT name,organization,orgid,associateid FROM client JOIN client_key WHERE client.client_ident = client_key.client_ident INTO OUTFILE '/tmp/clients.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment