0

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?

1

1 Answer 1

0

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, '.', ':');
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! I appreciate your help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.