0

任何想法我做错了什么???

INSERT INTO LondonFixes ('id', 'Metal', 'AmPm', 'GBP', 'USD', 'EUR', 'Updated')VALUES(NULL, 'Gold', 'AM', '1055.91', '1646.00', '1272.03', '2012-06-19')

给出以下错误:

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 ''id', 'Metal', 'AmPm', 'GBP', 'USD', 'EUR', 'Updated')VALUES(NULL, 'Gold', 'AM',' at line 1
4

2 回答 2

3
 INSERT INTO LondonFixes (id, Meta, AmPm, GBP, USD, EUR, Updated)
 VALUES(NULL, 'Gold', 'AM', '1055.91', '1646.00', '1272.03', '2012-06-19')
于 2012-06-19T02:13:17.670 回答
1

在 MySQL 中,如果要转义列名,请不要使用single quote,而是使用backtick.

INSERT INTO LondonFixes (`id`, `Metal`, `AmPm`, `GBP`, `USD`, `EUR`, `Updated`)
VALUES(NULL, 'Gold', 'AM', '1055.91', '1646.00', '1272.03', '2012-06-19')
于 2012-06-19T02:21:38.717 回答