March 30th, 2004, 09:37 PM
Delete statement with multiple inner joins
I would like to delete records in a table using the following SQL statement. The statement works successfully when using SELECT but returns an error when I try to use it as a DELETE. I recieve the error - "Incorrect syntax near the keyword 'INNER'." I am relatively new to using INNER JOINS and would like some assitance. Please...
DELETE FROM tblCompetency_Element
INNER JOIN tblCompetency ON tblCompetency.Competency_ID = tblCompetency_Element.Competency_ID
INNER JOIN tblFunctionalArea ON tblFunctionalArea.FunctionalArea_ID = tblCompetency.FunctionalArea_ID
INNER JOIN tblCompetencyType ON tblCompetencyType.CompetencyType_ID = tblFunctionalArea.CompetencyType_ID
WHERE tblCompetencyType.Community_ID = 4;