This loads and converts in one step, no need for another table. For more information see the manual.
LOAD DATA INFILE 'file.txt'
INTO TABLE t1
FIELDS TERMINATED BY ','
(column1, @var1, column3, ...)
SET column2 = STR_TO_DATE(@var1,'%Y%m%d')
More Related Contents:
- Delimiters in MySQL
- How to store Emoji Character in MySQL Database
- Group by clause in mySQL and postgreSQL, why the error in postgreSQL?
- MySQL: Quick breakdown of the types of joins [duplicate]
- Any way to select without causing locking in MySQL?
- Log all queries in mysql
- Truncate all tables in a MySQL database in one command?
- Cast from VARCHAR to INT – MySQL
- MySQL SELECT WHERE datetime matches day (and not necessarily time)
- Find distance between two points using latitude and longitude in mysql
- How to convert result table to JSON array in MySQL
- Export and Import all MySQL databases at one time
- MySQL: Select top n max values?
- MySQL search in comma list [duplicate]
- What is MySQL’s default ON DELETE behavior?
- MySQL error 1022 when creating table
- How do I setup ASP.NET MVC 2 with MySQL?
- mysql DECLARE WHILE outside stored procedure how?
- SELECT query return 1 row from each group
- MySql Single Table, Select last 7 days and include empty rows
- How can I check MySQL engine type for a specific table?
- mysql SQL: specific item to be first and then to sort the rest of the items
- Why doesn’t MySQL’s MyISAM engine support Foreign keys?
- SELECT INTO Variable in MySQL DECLARE causes syntax error?
- Where does MySQL store database files on Windows and what are the names of the files?
- When is a timestamp (auto) updated?
- Should I normalize my DB or not?
- Why is connecting to MySQL server so slow?
- Connect to mysql server without sudo
- How to search and replace all instances of a string within a database?