本文介绍了添加DATETIME列的Alter Table语法看起来像什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我想将默认值设置为mysql表时,找不到将DATETIME列添加到mysql表中的语法是什么-示例-2011-01-26 14:30:00
I can't find what the syntax looks like for adding a DATETIME column to a mysql table when I want to set the default to - example - 2011-01-26 14:30:00
有人知道该语法是什么样吗?
Does anyone know what that syntax looks like?
这就是我所拥有的
ADD COLUMN new_date DATETIME AFTER preceding_col,谢谢
推荐答案如果您有疑问,请在此处解释语法 dev.mysql/doc/refman/5.5/en/alter-table.html
If you ever have doubts, the syntax is explained here dev.mysql/doc/refman/5.5/en/alter-table.html
ALTER TABLE yourTable ADD COLUMN new_date DATETIME NOT NULL DEFAULT 20110126143000 AFTER preceding_col或
ALTER TABLE yourTable ADD COLUMN new_date DATETIME NOT NULL DEFAULT '2011-01-26 14:30:00' AFTER preceding_col(我更喜欢数字DATETIME格式)
(I just prefer the numeric DATETIME format)
更多推荐
添加DATETIME列的Alter Table语法看起来像什么?
发布评论