MySQL Forums
Forum List  »  Newbie

Re: Importing data with dates AND times spearately
Posted by: Rick James
Date: July 20, 2016 09:54AM

While you are importing the data, collect the date and time strings into @variables. Then put the combined value into a single DATETIME column. At the same time 'fix' the date since MySQL really wants the year first.

Something like...

LOAD DATA ...
@dat = ...,
@tim = ...,
mydatetime = STR_TO_DATE('...', CONCAT(@dat, ' ', @tim)),
...

Options: ReplyQuote


Subject
Written By
Posted
Re: Importing data with dates AND times spearately
July 20, 2016 09:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.