从Android应用程序中的表中删除一行比较其他表

时间:2013-02-20 10:33:36

标签: java android database

我有两张表A和B

A has aid, bid, aname columns
B has bid, bname columns

我想从A

中删除一行

delete from A where bid = (select bid from b where bname like '%Mass%' )

如何在Android中编写查询。

我可以单独执行select bid from b where bname like '%Mass%'并将id存储在变量中并运行类数据库的delete方法。

还有其他简单方法。

1 个答案:

答案 0 :(得分:0)

DELETE FROM A WHERE bid IN (SELECT bid FROM B WHERE bname LIKE '%Mass%')