我的表包含2个INTEGER主键列。我想删除指定了两个记录的几个记录。例如,(1,1)和(1,2)。我试过了:
DELETE FROM my_table WHERE(primarykey1,primarykey2) IN ((1,1),(1,2))
语法不正确。
答案 0 :(得分:2)
从SQLite 3.15版开始,您可以使用以下语法:
DELETE FROM my_table WHERE (p1, pk2) IN (VALUES(1,1),(1,2));
答案 1 :(得分:0)
DELETE FROM my_table WHERE primarykey1 = 1 AND primarykey2 IN (1,2)