DELETE FROM Table1
INNER JOIN View1 ON Table1.ID = View1.ID
WHERE Table1.ID = View1.ID;
錯誤是沒有結束的正確如何從一個表使用聯接SQL刪除行
DELETE FROM Table1
INNER JOIN View1 ON Table1.ID = View1.ID
WHERE Table1.ID = View1.ID;
錯誤是沒有結束的正確如何從一個表使用聯接SQL刪除行
你如何做這取決於SQL的方言。下面是應該在任何數據庫工作的方法:
DELETE FROM Table1
WHERE Table1.Id in (select Id from View1);
的
要刪除的記錄指定表的SQL命令,
DELETE Table1 -- <== this will delete records from Table1
FROM Table1
INNER JOIN Table2 ON Table1.ID = Table2.ID
WHERE Table1.ID = Table2.ID;
仍然沒有正常結束!我編輯了SQL,Table2實際上是一個View。 – meltonCG
DELETE Table1
FROM Table1
INNER JOIN View1
ON Table1.ID = View1.ID;
可能重複[如何刪除使用INNER JOIN與SQL Server?(http://stackoverflow.com/questions/16481379/how-delete-using- inner-join-with-sql-server) –