如何sqlite删除multiquery

时间:2014-10-21 05:52:52

标签: sql sqlite

如何删除sqlite多查询?

DELETE FROM table1,table2 WHERE table1.id = 2 and table2.id = 2

1 个答案:

答案 0 :(得分:0)

你可以像这样使用:

DELETE FROM table1 WHERE table1.id=2; DELETE FROM table2 WHERE table2.id=2;

一次执行多个查询。

示例:

String qry="DELETE FROM table1 WHERE table1.id=2; DELETE FROM table2 WHERE table2.id=2;";