我要删除Intent intent = new Intent(this, NextActivity.class);
startActivity(intent);
,同时移除tableA
中匹配tableB
目前,tableA.A_ID = tableB.A_ID
的{{1}}上的删除和更新设置为CASCADE
的外键设置为TableB
。
答案 0 :(得分:1)
暂时关闭约束
SET SQL_SAFE_UPDATES = 0;
DELETE FROM tableB b WHERE EXISTS ( SELECT * FROM tableA a WHERE a.A_ID = b.A_ID )
DELETE FROM tableA;
SET SQL_SAFE_UPDATES = 1;