1
我必須從slaveTable中刪除與masterTable表(死關係,從masterTable中刪除)沒有更多關係的行。SQL刪除與JOIN多個條件中的另一個表WHERE NULL
我想出了聲明:
DELETE
FROM slaveTable AS s
LEFT JOIN
masterTable AS m
ON (s.key1 = m.key1
AND s.key2 = m.key2)
WHERE m.key1 IS NULL
SQL DELETE with JOIN another table for WHERE condition 顯示這樣的解決方案......但不會爲我工作。 由於我缺乏聲譽,我無法在那裏回答。
的可能重複的[SQL刪除與JOIN用於WHERE條件的另一表(http://stackoverflow.com/questions/1980738/sql-delete-with-join-another-table-for-where-condition ) –