![]() In case the values in the result set contain NULL values, the target file will contain "N instead of NULL. INTO OUTFILE 'C:/tmp/orders.csv' FIELDS ENCLOSED BY '"' TERMINATED BY ' ' ESCAPED BY '"' LINES TERMINATED BY '\r\n') Code language: SQL (Structured Query Language) ( sql )Īs the query showed, you need to include the column heading of every column. ( SELECT orderNumber,orderDate, status FROM orders To add the column headings, you need to use the UNION statement as follows: ( SELECT 'Order Number', 'Order Date', 'Status') It would be convenient if the CSV file contains the first line as the column headings so that the file is more understandable. ![]() You can wrap the command by an event and schedule the event run periodically if needed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |