I am trying to delete some data from one table using multiple table. The problem i am having with this query is that it is deleting data that is not suppose to delete. I want to delete only the Data where ID's in both tables are DIFFERENT. In other words, i want to keep when the ID's in both tables are the same. Here is my query:
delete Tabel1
from Table1 r join
Table2 w on r.ID <> w.ID
and w.Date_Assigned is not null