Using SELECT INTO, we can save the output of a select command into a file.Instead of displaying the output on the screen
mysql> SELECT * INTO OUTFILE '/tmp/employee.txt' FROM employee;
We can also store the output into a comma delimited file by specifying the “FIELDS TERMINATED BY”
mysql> SELECT * INTO OUTFILE '/tmp/employee1.txt' FIELDS TERMINATED BY ',' FROM employee;
mysql> SELECT * INTO OUTFILE '/tmp/employee.txt' FROM employee;
We can also store the output into a comma delimited file by specifying the “FIELDS TERMINATED BY”
mysql> SELECT * INTO OUTFILE '/tmp/employee1.txt' FIELDS TERMINATED BY ',' FROM employee;
No comments:
Post a Comment