添加DATETIME列的Alter Table语法看起来像什么?

编程入门 行业动态 更新时间:2024-10-28 06:36:26
本文介绍了添加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语法看起来像什么?

本文发布于:2023-10-25 03:23:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1525780.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语法   DATETIME   Alter   Table

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!