注册 登录
编程论坛 MySQL论坛

[求助]列timestamp为何无法使用default?

xqiang 发布于 2006-09-26 16:33, 1987 次点击
create table test (
'UpDate' timestamp default current_timestamp
);

就这么简单的一名建表,为何就是不成功?
报错是这样的:
ERROR 1064 (42000): You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near 'curr
ent_timestamp)' at line 2

有谁知道这是怎么回事?

谢谢
1 回复
#2
mouse30778592011-06-10 10:00
两个问题
1.添加字段名不需要加引号
2.字段名不能用mysql关键字 比如update
写成如下应该ok
create table test (
UpDate1 timestamp default current_timestamp
);
1