mysql> DESC transaction;
+-------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| title | varchar(100) | NO | | NULL | |
| from | int(11) | NO | | NULL | |
| to | int(11) | NO | | NULL | |
| cost | int(11) | NO | | NULL | |
+-------+--------------+------+-----+---------+----------------+
5 rows in set (0.01 sec)
mysql> INSERT INTO transaction (title, from, to, cost) VALUES ('Ham', 1, 4, 9000);
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 'from, to, cost) VA
LUES ('Ham', 1, 4, 9000)' at line 1
我試圖插入數據到'transaction'表。我認爲查詢很好,但它說錯誤。我的問題是什麼?請幫幫我!錯誤1064(42000):您的SQL語法有錯誤;我找不到我做錯了
我想通出。我想這是因爲在查詢中使用'from'。這樣對嗎? –