I have a dataset (in csv) which contains a column with value like "13.22.00". I would like to guess this is "hh.mm.ss".
How can I convert it to type time (it is string now) like hh:mm:ss?
I have a dataset (in csv) which contains a column with value like "13.22.00". I would like to guess this is "hh.mm.ss".
How can I convert it to type time (it is string now) like hh:mm:ss?
You can use the SET clause in LOAD DATA to transform the input data before putting it into the table. E.g. if the time is in column 2 of the CSV and you want to put the time into the time column of the table
LOAD DATA INFILE "filename"
(col1, @col2, col3, ...)
SET time = REPLACE(@col2, '.', ':');