MySQL Forums
Forum List  »  Newbie

Re: Loading CSV Data with commas
Posted by: Peter Brawley
Date: May 19, 2021 01:16PM

It works with ...

FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
(mcc_code, end_mcc_code, mcc_description)

... and without ...

set row_id = null

select * from mcc_codes;
+--------+----------+--------------+---------------------------------+
| row_id | mcc_code | end_mcc_code | mcc_description                 |
+--------+----------+--------------+---------------------------------+
|      1 | 0000     |              | Payment                         |
|      2 | 00742    |              | Veterinary Services             |
|      3 | 00763    |              | Agricultural Cooperative        |
|      4 | 00780    |              | Landscaping Services            |
|      5 | 01520    |              | General Contractors             |
|      6 | 01711    |              | Heating, Plumbing, A/C          |
|      7 | 01731    |              | Electrical Contractors          |
|      8 | 01740    |              | Masonry, Stonework, and Plaster |
+--------+----------+--------------+---------------------------------+

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.