Need a Column Delimiter in MySQL

56 views Asked by At

I am very new to MySQL. I am trying to load a CSV file into MySQL Table.

load data local infile 'C:/Users/fg/Downloads/test.csv' into table my_schema.my_table
fields terminated by ','
escaped by '"'
ignore 1 rows;

The problem is that I do not know how to apply a Column Delimiter because, for example I have a column containing this value "Adam Steven & David, Brown". Due to the Fields terminated by ',' the value is separated into two "Adam Steven & David" and "Brown". Any ideas how I can apply a Column Delimiter?

Note: Only the values with several names have double quotes. Those with one name do not have double quotes. If I apply ENCLOSED BY clause, it imports only the values with double quotes. The OPTIONALLY ENCLOSED BY is acting the same way as ENCLOSED BY for some unclear reason.

0

There are 0 answers