I've got a MySQL load script that almost works, it is perfect except for the date columns, which are not in a MySql friendly format.
load data infile '/Users/pfarrell/sandbox/waybase/folklore/Titles_1976.csv'
into table fix76
fields terminated by ','
enclosed by '"'
ignore 1 lines
( patentId, USPatentNum, title, grantDate, filedDate)
The problem is that my dates are in mm/dd/yyyy format. Looks like the str_to_date
function is what I want, but I can't figure out how to use it in the load command.
I'm envisioning something like:
grantDate = STR_TO_DATE(something, '%m/%d/%Y'),
but that doesn't work.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…