MySQL错误:列数与行不匹配

时间:2019-09-19 11:40:51

标签: mysql

当我尝试插入多个值时,出现错误

  

列数与行不匹配

我尝试分别插入每个值,并且效果很好

insert into book.books(title, author_fname,author_lname,released_year,stock_quantity,pages)
values  ('The Namesake','Jhumpa','Lahiri',2003,32,291),
('Norse Mythology','Neil','Gaiman',2016,43,304),
('American Gods','Neil','Gaiman',2001,12,465),
('Interpreter of maladies','Jhumpa','Lahiri',1996,97,198),
('A hologram for the king: A novel','Dave','Eggers',2012,154,352),
('The Circle','Dave','Eggers',2013,26,504),
('Just kids','Patti','Smith',2010,55,304),
('The Amazing adventures of kavalier & lay','Micheal','Chabon',2000,68,634),
('A heartbreaking world of staggering genius','Dave','Eggers',2001,104,437),
('Coraline','Neil','Gaiman',2003,100,208),
('What we talk about when we talk about love:stories','Raymond','carver',1981,23,176),
('where i am calling from : selected stories','Raymond','carver',1989,12,526),
('white noise','Don','Delillo',1985,49,320),
('Cannery row','John','Steinbeck',1945,95,181),
('Oblivion:stories','David','Foster Wallace',2004,172,329),
('Consider the lobster''David','Foster Wallace',2005,92,343);

我哪里出错了?如何一次全部插入而不会出现错误?

1 个答案:

答案 0 :(得分:0)

请检查最新记录 (“考虑龙虾”戴维”,“福斯特·华莱士”,2005,92,343);

这将是... (“考虑龙虾”,“大卫”,“福斯特·华莱士”,2005,92,343);

相关问题