Alter SQL table - allow NULL column value

前端 未结 2 477
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-03 21:31

Initially, the table \"MyTable\" has been defined in the following way:

CREATE TABLE IF NOT EXISTS `MyTable` (
  `Col1` smallint(6) NOT NULL AUTO_INCREMENT,
         


        
相关标签:
2条回答
  • 2021-01-03 22:10
    ALTER TABLE MyTable MODIFY Col3 varchar(20) NULL;
    
    0 讨论(0)
  • 2021-01-03 22:17

    The following MySQL statement should modify your column to accept NULLs.

    ALTER TABLE `MyTable`
    ALTER COLUMN `Col3` varchar(20) DEFAULT NULL
    
    0 讨论(0)
提交回复
热议问题