Answer the question
In order to leave comments, you need to log in
What is the algorithm for importing CSV into the database?
Greetings
There is a table in the database with the fields: id, name, age
There is a CSV file with the fields: id, name, age, gender I
import CSV into the database and the gender field is skipped, does not appear in the database - is it supposed to be, is this normal behavior? If there are fields in the CSV that match the names of the fields in the database, then only those that match will be imported, and the rest will be ignored - right?
It's just that there is a CSV file and the reluctance to delete several columns from it when importing.
Answer the question
In order to leave comments, you need to log in
LOAD DATA INFILE '/status2_50m.csv'
INTO TABLE compression_test.accounts_status50m
FIELDS TERMINATED BY ';' ESCAPED BY '\\'
LINES STARTING BY '' TERMINATED BY '\n'
IGNORE 1 LINES
(@col1,@col2,@col3) set [email protected],[email protected],[email protected];
(@col1,@col2,@col3) set [email protected],[email protected],[email protected];
A new field should not be added to the database during normal file import. First, bring the database structure to the desired form, and then load the data from the file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question