我尝试使用 python 将数据插入表中,但出现语法错误。这是我的表格格式。
mycursor.execute("""CREATE TABLE workers (
`ID` int(5) NOT NULL AUTO_INCREMENT,
` x` FLOAT NOT NULL,
` y` FLOAT NOT NULL,
`z` FLOAT NOT NULL,
`Acc` int NOT NULL,
`Datasource` char(3) NOT NULL,
`Datatype` int(5) NOT NULL,
PRIMARY KEY (`ID`))""")
表格代码工作正常
这是我试图插入这些表的数据
mycursor.execute("""INSERT INTO workers VALUES
(1,\
1.2720693 ,\
6.583606 ,\
6.8299093 ,\
3 ,\
"Acc" ,\
1)""")
这是我得到的错误
mysql.connector.errors.ProgrammingError: 1064 (42000): 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 '\
1.2720693 ,6.583606 ,6.8299093 ,3 ,"Acc" ,1)' at line 2