How to skip columns in CSV file when importing into MySQL table using LOAD DATA INFILE?

From Mysql docs:

You can also discard an input value by
assigning it to a user variable and
not assigning the variable to a table
column:

LOAD DATA INFILE 'file.txt'  
INTO TABLE t1 (column1, @dummy, column2, @dummy, column3);

Leave a Comment