开发者

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

  1. add a new column to hold the real timestamp
  2. use an update statement to populate the new column from the varchar column, using the STR_TO_DATE function
  3. remove the varchar column
  4. rename the new column
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜