Reputation: 135
Theere is a Tasks table and a Contacts table where the initial data is stored
Upvotes: 1
Views: 1990
Reputation: 1093
Below statement deletes all records in EmployeestoTasks having a task that does not exist in Tasks:
DELETE
FROM EmployeestoTasks
WHERE NOT EXISTS
(
SELECT '1'
FROM Tasks
WHERE Tasks.Title = EmployeestoTasks.Task
)
Upvotes: 1