开发者

How do I alter a timestamp to set by default to the current time?

The code below doesn't seem to work even though the collumn and table does exist, any ideas?

ALTER开发者_C百科 TABLE `table` CHANGE 'collumn_1' 'collumn_1' TIMESTAMP DEFAULT 'CURRENT_TIMESTAMP' NOT NULL

I'm just trying to make the collumn available so it can store the current date and time when any data is added to this table.


ALTER TABLE `table` MODIFY collumn_1 TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜