我在 MySQL 中尝试将新数据插入数据表时收到错误 1064。我已经查找了该错误,但找不到任何解决该问题的 Stack Overflow 问题。
ERROR 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
以下是该表的说明:
+-----------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| coord1lat | double | NO | | NULL | |
| coord1lon | double | NO | | NULL | |
| coord3lat | double | NO | | NULL | |
| coord3lon | double | NO | | NULL | |
| status | char(1) | NO | | NULL | |
+-----------+---------+------+-----+---------+----------------+
6 rows in set (0.00 sec)
这是我尝试插入的示例行:
insert into sample_parking_spots (null, 47.60624, -122.299735, 47.60226, -122.299687, 'T');
这是我收到的错误:
ERROR 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 'null, 47.60624, -122.299735, 47.60226, -122.299687, 'T')' at line 1
如果这确实与问题重复,我深表歉意,但我对 MySQL 很陌生,并且多次查看了我试图插入的数据行。
最佳答案
您忘记了关键字VALUES
insert into sample_parking_spots VALUES (null, 47.60624, -122.299735, 47.60226, -122.299687, 'T');
关于MySQL - 负 double 和字符语法 1064 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34770985/