mysql创建表如何添加两个timestamp

mysql创建表如何添加两个timestamp字段

在用mysql创建timestamp字段时出错

`Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause`

如何解决

```
CREATE TABLE `test_table` (

`id` INT( 10 ) NOT NULL,

`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,

`update_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

) ENGINE = INNODB;
```

    A+
发布日期:2022年09月08日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: