我将值添加到表" 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');
PS。我对SQL的经验很少,所以如果我搞砸了一些明显的事情,请提前抱歉。
答案 0 :(得分:0)
从表名和列名中删除单引号。
将[]添加到订单列,因为它是保留字。
从你的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');
再试一次。