viernes, 2 de agosto de 2013

MySQL export sql select to csv file.

To export data from a sql statement in a MySQL environment, to a csv file:

select * into outfile '/var/tmp/1.csv' fields terminated by ',' enclosed by '"' lines terminated by '\n' from tabla1;

This SQL statement will export the desired data to the file /var/tmp/1.csv, in this example fields are separated by commas.

No hay comentarios:

Publicar un comentario