我有两张表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方法。
还有其他简单方法。
答案 0 :(得分:0)
DELETE FROM A WHERE bid IN (SELECT bid FROM B WHERE bname LIKE '%Mass%')