我正在尝试在已创建的数据库中创建一个表。我已经使用USE church_fpip
. 这是我创建新表的代码,但由于某种原因,ZEROFILL 似乎正在创建语法错误。
mysql> CREATE TABLE sermons (
-> id INT NOT NULL AUTO_INCREMENT,
-> year INT(4) NOT NULL,
-> month INT(2) NOT NULL ZEROFILL,
-> day INT(2) NOT NULL ZEROFILL,
-> title VARCHAR(50) NOT NULL,
-> preacher VARCHAR(30) NOT NULL,
-> length INT(3) NOT NULL,
-> visible TINYINT(1) NOT NULL,
-> PRIMARY KEY (id)
-> );
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 'ZEROFILL,
day INT(2) NOT NULL ZEROFILL,
title VARCHAR(50) NOT NULL,
preach' at line 4