gpt4 book ai didi

mySQl 插入现有表语法错误

转载 作者:行者123 更新时间:2023-11-29 19:03:30 27 4
gpt4 key购买 nike

我试图在“员工”表中添加这些值,但它显示了一个我无法修复的错误,有帮助吗?!

语法:

INSERT INTO `employee`( 'UserName',`ID`, `firstname`, `middlename`,'lastname','Address','department','salary','password','phonenumber','email','LoginStatus') 
VALUES ('medo',1','ahdjh','rgetrhytyiu','rgthyu','','2','100000','','24741585285','da@hash.com','1')

错误:

Error: INSERT INTO employee( 'UserName',ID, firstname, middlename,'lastname','Address','department','salary','password','phonenumber','email','LoginStatus') VALUES ('medo',1','ahdjh','rgetrhytyiu','rgthyu','','2','100000','','24741585285','da@hash.com','1') 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 ''UserName',ID, firstname, middlename,'lastname','Address','department','sa' at line 1

最佳答案

试试这个:从列中删除引号--

INSERT INTO employee( UserName,ID, firstname, middlename,lastname,Address,department,salary,password,phonenumber,email,LoginStatus) VALUES ('medo',1','ahdjh','rgetrhytyiu','rgthyu','','2','100000','','24741585285','da@hash.com','1')

关于mySQl 插入现有表语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43686089/

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