How to change VARCHAR type to DATETIME using ALTER in MySQL?

后端 未结 3 1268
北海茫月
北海茫月 2020-12-30 00:34

How can I change VARCHAR() type to DATETIME using ALTER in MySQL?

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 01:11

    Try this query.

    ALTER TABLE  `table_name` CHANGE  `From Date`  `From Date` DATETIME NULL DEFAULT '0000-00-00 00:00:00';
    

提交回复
热议问题