Skip to content

Instantly share code, notes, and snippets.

@ramingar
Last active May 22, 2020 10:35
Show Gist options
  • Save ramingar/0b7c1f7dd3c0f54ed9826c168ea62f26 to your computer and use it in GitHub Desktop.
Save ramingar/0b7c1f7dd3c0f54ed9826c168ea62f26 to your computer and use it in GitHub Desktop.
Exporta los resultados de una tabla a un archivo csv #mysql #import #csv #terminal
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