如何在SQLite上连接表时进行更新?我试过:UPDATE closure JOIN item ON ( item_id = id ) SET checked = 0 WHERE ancestor_id = 1以及:UPDATE closure, item
SET checked = 0 WHERE ancestor_id = 1 AND item_id = id这两种方法都适用于MySQL,但这给我带来了SQLite中的语法错误。如何使此更新/连接与SQLite版本3.5.9一起工作?
3 回答
喵喵时光机
TA贡献1846条经验 获得超7个赞
UPDATE closure SET checked = 0 WHERE item_id IN (SELECT id FROM item WHERE ancestor_id = 1);
添加回答
举报
0/150
提交
取消