我正在尝试在我的数据库上使用两个 UPDATE 查询:
UPDATE equipment
SET equip_level = 'Hero'
WHERE equip = ('Amulet of Immortality');
UPDATE equipment
SET equip_level = 'Master'
WHERE equip = ('Shield of Pitch Black', 'Blade of MageBane', 'Leggings of Spikes', 'Gloves of Quickling skin', 'Helm of the Fire King', 'Scythe of Death');
第一个工作得很好,但第二个(有多个条目)给了我以下错误:
[11:37:16] Error while executing SQL query on database 'test': row value misused
我正在看的教程(https://digitalfellows.commons.gc.cuny.edu/2016/04/08/fun-times-with-sqlite-or-a-beginners-tutorial-to-data-management -and-databases-with-sql/)对第二个查询使用以下格式:
UPDATE equipment
SET equip_level = 'Master'
WHERE equip = IN ('Shield of Pitch Black', 'Blade of MageBane', 'Leggings of Spikes', 'Gloves of Quickling skin', 'Helm of the Fire King', 'Scythe of Death')
但这给了我一个语法错误:
[11:49:48] Error while executing SQL query on database 'test': near "IN": syntax error
我该如何纠正?