CREATE TABLE `info` ( `Useno` char(20) NOT NULL, `ISBN` char(20) NOT NULL, `Borrowdate` date NOT NULL, `Yesorno` char(4) NOT NULL, `Overdue` char(4) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8;我是用编辑器编辑的..代码是自动生成的...Borrowdate这是要实现的列..
CREATE TABLE `info` ( `Useno` char(20) NOT NULL, `ISBN` char(20) NOT NULL, `Borrowdate` date NOT NULL DEFAULT CURDATE(), `Yesorno` char(4) NOT NULL, `Overdue` char(4) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `info` ( `Useno` char(20) NOT NULL, `ISBN` char(20) NOT NULL, `Borrowdate` timestamp NOT NULL default CURRENT_TIMESTAMP, `Yesorno` char(4) NOT NULL, `Overdue` char(4) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
...这个方法我昨天晚上试了... 我在MySQL命令行输入的...可是这个表建立不成功..
Error Code : 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 'CURDATE(), `Yesorno` char(4) NOT NULL, `Overdue` char(4) NOT NULL ) ENGINE=M' at line 3
我不是用代码编写的..是用Mysql-Front和Navicat创建的数据库
我在默认值那栏写curdate(),还是不行..
是字段?建表的SQL语句贴出来看看,怎么不行
`Useno` char(20) NOT NULL,
`ISBN` char(20) NOT NULL,
`Borrowdate` date NOT NULL,
`Yesorno` char(4) NOT NULL,
`Overdue` char(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;我是用编辑器编辑的..代码是自动生成的...Borrowdate这是要实现的列..
`Useno` char(20) NOT NULL,
`ISBN` char(20) NOT NULL,
`Borrowdate` date NOT NULL DEFAULT CURDATE(),
`Yesorno` char(4) NOT NULL,
`Overdue` char(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
`Useno` char(20) NOT NULL,
`ISBN` char(20) NOT NULL,
`Borrowdate` timestamp NOT NULL default CURRENT_TIMESTAMP,
`Yesorno` char(4) NOT NULL,
`Overdue` char(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
我在MySQL命令行输入的...可是这个表建立不成功..
Error Code : 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 'CURDATE(),
`Yesorno` char(4) NOT NULL, `Overdue` char(4) NOT NULL )
ENGINE=M' at line 3