我有一个创建表格的脚本,然后插入一行。这是我为创建表而执行的 SQL 代码:
CREATE TABLE polls (
id INT NOT NULL UNIQUE AUTO_INCREMENT,
name VARCHAR(255) NOT NULL UNIQUE,
author VARCHAR(255) NOT NULL,
created DATETIME NOT NULL,
expires DATETIME,
PRIMARY KEY(id)
)
这里是我添加新行的地方:
INSERT INTO polls
VALUES ('TestPoll'),('Billy Bob'),('2013-05-01 04:17:31'),('2013-05-01 04:17:31')
或者
INSERT INTO polls
VALUES ('TestPoll','Billy Bob','2013-05-01 04:17:31','2013-05-01 04:17:31')
(无论如何我都会遇到同样的错误)
我总是收到这个错误:
<class '_mysql_exceptions.OperationalError'>, OperationalError(1136, "Column count doesn't match value count at row 1"), <traceback object at 0x7f7bed982560>