我有一張表說table1有50條記錄,table1的記錄與其他子表使用約束綁定。刪除查詢以刪除無約束的條目
不是所有的50個記錄有約束,有可能是一些記錄(比如15)無約束的,所以我要運行刪除查詢刪除15項單獨出總50
我試過delete ignore
聲明:
delete ignore from table1;
,但它並沒有幫助&我得到這個錯誤:
Cannot delete or update a parent row: a foreign key constraint fails
什麼是最好的方式ACC在mysql查詢中忽略這個?
你能簡單地刪除其中的FK爲空? – 2011-06-14 22:22:24
任何示例示例? – Sharpeye500 2011-06-14 22:29:48