Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save heylastway/44912bf1afa73a2a581a54156a931516 to your computer and use it in GitHub Desktop.
Save heylastway/44912bf1afa73a2a581a54156a931516 to your computer and use it in GitHub Desktop.
SELECT order_id,product_name,qty
FROM orders
WHERE foo = 'bar'
INTO OUTFILE '/var/lib/mysql-files/orders.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