mysql 设置字段默认值为当前时间加5分钟 10
CREATETABLEVIDEO.T_US_VERIFY_CODE(funcidVARCHAR(4),maketimedatetimeDEFAULTnow(),msisd...
CREATE TABLE VIDEO.T_US_VERIFY_CODE (
funcid VARCHAR (4),
maketime datetime DEFAULT now(),
msisdn VARCHAR (11) NOT NULL,
overtime datetime DEFAULT DATE_ADD(NOW(),INTERVAL 5 MINUTE) ,
portaltype VARCHAR (4) DEFAULT '2',
verifycode VARCHAR (10),
returncode VARCHAR (50)
)
[Err] 1064 - 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 'DATE_ADD(NOW(),INTERVAL 1/24/60*5) ,
portaltype VARCHAR (4) DEFAULT '2',
ver' at line 5
overtime 想设置默认值为当前时间再加上5分钟 展开
funcid VARCHAR (4),
maketime datetime DEFAULT now(),
msisdn VARCHAR (11) NOT NULL,
overtime datetime DEFAULT DATE_ADD(NOW(),INTERVAL 5 MINUTE) ,
portaltype VARCHAR (4) DEFAULT '2',
verifycode VARCHAR (10),
returncode VARCHAR (50)
)
[Err] 1064 - 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 'DATE_ADD(NOW(),INTERVAL 1/24/60*5) ,
portaltype VARCHAR (4) DEFAULT '2',
ver' at line 5
overtime 想设置默认值为当前时间再加上5分钟 展开
1个回答
展开全部
CREATE TABLE `test1` (
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`c` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
建表test1。3个字段 a,b,c
insert into test1 VALUES(NULL,NULL,NULL)
插入的时候设置3字段都是 null
然后成功
Affected rows : 1, Time: 0.00sec
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`c` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
建表test1。3个字段 a,b,c
insert into test1 VALUES(NULL,NULL,NULL)
插入的时候设置3字段都是 null
然后成功
Affected rows : 1, Time: 0.00sec
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询