varchar(50) data type containing timestamp in this format dd/mm/yyyy 00:00:00.000, now this is to be converted to MySQL timestamp
I have a MySQL table with Datetime as a column in varchar(50) data type containing timestamp in this format dd/mm/yyyy 00:00:0开发者_如何学Python0.000, now this is to be converted to MySQL timestamp... how do we do that?
I would
- add a new column to hold the real timestamp
- use an update statement to populate the new column from the varchar column, using the STR_TO_DATE function
- remove the varchar column
- rename the new column
精彩评论