我尝试通过插入新属性 date1 来更改表,它将自动设置表中每个条目的日期。
当我插入查询时
ALTER TABLE `vessellist` ADD `date1` DATE NOT NULL DEFAULT CURRENT_TIMESTAMP FIRST;
它说日期1的默认值无效
最佳答案
The DEFAULT clause specifies a default value for a column. With one exception, the default value must be a constant; it cannot be a function or an expression. This means, for example, that you cannot set the default for a date column to be the value of a function such as NOW() or CURRENT_DATE. The exception is that you can specify CURRENT_TIMESTAMP as the default for a TIMESTAMP column
关于MYSQL修改表current_time默认错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37144628/