Created
October 4, 2023 10:21
-
-
Save inoyakaigor/7e406b1152076fdbebfdbe55e1cd3d8a to your computer and use it in GitHub Desktop.
MySQL/MariaDB import from CSV with multiple SET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOAD DATA LOW_PRIORITY LOCAL INFILE 'C:\\Users\\InoY\\DOWNLO~1\\927D~1.CSV' | |
REPLACE INTO TABLE `pomoyka`.`jira_tasks` | |
CHARACTER SET utf8mb4 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 | |
LINES (`key`, `resume`, @created, @updated, `status_from`, `status_to`, @status_date) | |
SET `created` = STR_TO_DATE(@created, '%d.%m.%Y %H:%i:%s'), | |
`updated` = STR_TO_DATE(@updated, '%d.%m.%Y %H:%i:%s'), | |
`status_date` = STR_TO_DATE(@status_date, '%d.%m.%Y %H:%i:%s') | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment