gpt4 book ai didi

mysql - LOAD DATA INFILE 使用 STR_TO_DATE(@var1 ,'%m/%d/%Y') 转换 2 个日期 - 抛出错误

转载 作者:可可西里 更新时间:2023-11-01 07:56:51 26 4
gpt4 key购买 nike

这是一个错误,我不知道为什么,有什么想法吗?

LOAD DATA LOCAL INFILE 'H:/Data/DB__Muni/data/msrb_AZ_short1.csv'
INTO TABLE import_mdrp FIELDS TERMINATED BY ';' LINES TERMINATED BY '\r\n'
(
Issuer, cusip6, state, Issue,
page_pointer, @var1, date_rng, cusip9, @var2,
yield, Amt_Offer_Dlr, Amt_Offer_Per, Security_Description,
Fitch, Moody, cusip_img, fitch_img, moody_img
)
SET maturity = STR_TO_DATE(@var2,'%m/%d/%Y')
SET issue_date = STR_TO_DATE(@var1,'%m/%d/%Y')
;

最佳答案

代替

SET maturity = STR_TO_DATE(@var2,'%m/%d/%Y') 
SET issue_date = STR_TO_DATE(@var1,'%m/%d/%Y')

尝试

SET maturity = STR_TO_DATE(@var2,'%Y-%m-%d') 
SET issue_date = STR_TO_DATE(@var1,'%Y-%m-%d')

更新 1

SET maturity = DATE_FORMAT(STR_TO_DATE(@var2, '%m/%d/%Y'), '%Y-%m-%d'),
issue_date = DATE_FORMAT(STR_TO_DATE(@var1, '%m/%d/%Y'), '%Y-%m-%d')

关于mysql - LOAD DATA INFILE 使用 STR_TO_DATE(@var1 ,'%m/%d/%Y') 转换 2 个日期 - 抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13280977/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com