这让我疯狂。我试图插入值下面的 “统计” 表:如何在WHERE子句中使用_date插入记录?
_date spam1
-----------------
2011-06-13
使用
INSERT INTO stats (spam1) VALUES (7) WHERE `_date` = '2011-06-13'
的MySQL返回
#1064 - 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 'WHERE `_date` = '2011-06-13'' at line 1
我不明白。删除日期周围的引号或_date附近的反引号也无济于事。我究竟做错了什么?
[编辑] 谢谢 - 你都得到了给予好评:)是我的错......我当然需要更新,而不是INSERT ...时间休息一下我猜:P