【问题标题】:MySQL Insert Into Error Code 1136MySQL插入错误代码1136
【发布时间】:2017-12-03 21:54:00
【问题描述】:

我在 MySQL Workbench 我已经创建了一个表,现在想要插入数据,但 MySQL 说,“错误代码:1136 列计数与第 1 行的值计数不匹配)这有点令人困惑。

请高人指教。

CREATE table 05FinancialForecast
(
ID INT,
Username VARCHAR (12),
Region VARCHAR (12),
ProductGroup VARCHAR (25),
Product VARCHAR (25),
Customer VARCHAR (30),
SalesRep VARCHAR (20),
ProductLine VARCHAR (15),
TransactionDate DATE, 
TransactionCode TEXT,
Units SMALLINT,
CountryCode VARCHAR(4),
GlobalUnit SMALLINT,
SALES SMALLINT,
2017Forecast SMALLINT,
2018Forecast SMALLINT,
2019Forecast SMALLINT,
2020Forecast SMALLINT,
2021Forecast SMALLINT,
2022Forecast SMALLINT,
2023Forecast SMALLINT,
2024Forecast SMALLINT,
2025Forecast SMALLINT,
2026Forecast SMALLINT,
2027Forecast SMALLINT,
2028Forecast SMALLINT
)



INSERT INTO 05financialforecast
(
ID, Username, Region, ProductGroup, Product, Customer, SalesRep, ProductLine, TransactionDate, TransactionCode,
Units, CountryCode, GlobalUnit, SALES, 2017Forecast ,2018Forecast, 2019Forecast, 2020Forecast, 2021Forecast,
2022Forecast, 2023Forecast, 2024Forecast, 2025Forecast, 2026Forecast, 2027Forecast, 2028Forecast 
) Values


(1,
"Shrik1",
"West",
"Freestyle",
"Carlota",
"BFGM company",
"Phlem",
"Beginner",
"01-05-2015",
"421251FreestyleWestPhlem",
20,
"AFG",
500,10000,250,23000,23500,24000,24500,25000,25500,26000,26500,27000,27500,28000,28500);

【问题讨论】:

  • 这听起来像是一个不言自明的错误,您是否对此进行过任何研究和/或您是否计算过您尝试插入的字段数以及表格的字段数?

标签: mysql insert insert-into


【解决方案1】:

您正在为 26 列输入 27 个值。

【讨论】:

    猜你喜欢
    • 2016-06-08
    • 1970-01-01
    • 2015-07-12
    • 2018-09-27
    • 2015-06-19
    • 1970-01-01
    • 1970-01-01
    • 2018-10-31
    • 2019-04-07
    相关资源
    最近更新 更多