這是一個非常基本的問題,非常抱歉。爲什麼INSERT INTO語句不工作?
我有一個簡單的SQL(MySQL5)表,我試圖命令行插入數據到它。但它不斷彈出一個錯誤,我不知道爲什麼。
這是我的控制檯輸出:
mysql> SHOW COLUMNS from queries;
+-------+-----------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------+------+-----+-------------------+-----------------------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| query | varchar(100) | NO | | NULL | |
| date | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| match | int(11) | YES | | NULL | |
+-------+-----------+------+-----+-------------------+-----------------------------+
4 rows in set (0.00 sec)
mysql> INSERT INTO queries (query, match) VALUES ('cheese', 4);
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 'match) VALUES ('cheese', 4)' at line 1
mysql>
這是怎麼回事?爲什麼我的INSERT INTO命令不起作用?