gpt4 book ai didi

mysql - 使用 MySQL 将数据插入表时出错

转载 作者:行者123 更新时间:2023-11-29 15:31:00 25 4
gpt4 key购买 nike

我正在尝试使用 MySQL 将值插入到我的 employee 表中。

我的代码

INSERT INTO employee 
VALUES(100, 'David', 'Wallace', '1967-11-17', 'M', 250000, NULL, NULL);

错误

ER_PARSE_ERROR: 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
'INSERT INTO employee
VALUES(100, 'David', 'Wallace', '1967-11-17', 'M', 250000, ' at line 5

它不允许我在员工表中输入任何数据。

如何解决这个问题?

最佳答案

查看这个一般示例:

INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);

来源:https://www.w3schools.com/sql/sql_insert.asp

在您的情况下,您没有提到所有列,如果您要为所有列插入值,这很好。看到你的 table 会很有趣。

关于mysql - 使用 MySQL 将数据插入表时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58737036/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com