我正在将值添加到表"traders_data"中,但是当我执行SQL时,我收到以下错误:
('["M1126_ICV_M2_EP1",2]', 1000, '[8,"ItemGoldBar10oz",1]', '[3,"ItemGoldBar10oz",1]',0, 534, 'trade_any_vehicle'),
('["
[Msg] Finished - Unsuccessfully
我找不到任何语法原因来解释为什么会发生这种情况。完整的代码如下,如果有人知道发生了什么,我将不胜感激。
INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES
('["Ural_ZU23_CDF",2]', 1000, '[2,"ItemBriefcase100oz",1]', '[9,"ItemGoldBar10oz",1]',0, 534, 'trade_any_vehicle'),
('["M1126_ICV_M2_EP1",2]', 1000, '[8,"ItemGoldBar10oz",1]', '[3,"ItemGoldBar10oz",1]',0, 534, 'trade_any_vehicle'),
('["M1126_ICV_mk19_EP1",2]', 1000, '[8,"ItemGoldBar10oz",1]', '[3,"ItemGoldBar10oz",1]',0, 534, 'trade_any_vehicle'),
('["BAF_Jackal2_GMG_W",2]', 1000, '[6,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 534, 'trade_any_vehicle');
附言。我对SQL的经验很少,所以如果我搞砸了一些明显的事情,提前抱歉。
从表名和列名中删除单引号。
将 [ ] 添加到"顺序"列,因为它是保留字。
从 sql 末尾删除"",""。
INSERT INTO traders_data(item,qty,buy,sell,[order],tid,afile)
VALUES
('["Ural_ZU23_CDF",2]', 1000, '[2,"ItemBriefcase100oz",1]','[9,"ItemGoldBar10oz",1]',0, 534, 'trade_any_vehicle')
,('["M1126_ICV_M2_EP1",2]', 1000, '[8,"ItemGoldBar10oz",1]', '[3,"ItemGoldBar10oz",1]',0, 534, 'trade_any_vehicle')
,('["M1126_ICV_mk19_EP1",2]', 1000, '[8,"ItemGoldBar10oz",1]', '[3,"ItemGoldBar10oz",1]',0, 534, 'trade_any_vehicle')
,('["BAF_Jackal2_GMG_W",2]', 1000, '[6,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 534, 'trade_any_vehicle');
再试一次。