![]() ![]() INTO OUTFILE 'C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/employee_backup.csv' SELECT Id, Name, Email, Phone, City FROM employee_detail To export the table data into a CSV file, we need to execute the query as follows: If we execute the SELECT statement, we will see the following output: Export MySQL data in CSV format using the SELECT INTO. INSERT INTO employee_detail ( Id, Name, Email, Phone, City) It is to ensure that we have a file privilege to use this syntax. This statement is a compliment of the LOAD DATA command, which is used to write data from a table and then export it into a specified file format on the server host. To export the table into a CSV file, we will use the SELECT INTO.OUTFILE statement.
0 Comments
Leave a Reply. |