>>DELETE FROM New_Master WHERE Accountno In (Select Accountno Number FROM Master WHERE ; >>New_master.Phoneno= Master.Phoneno AND New_master.Exchange= Master.Exchange AND ; >>New_master.firstname= Master.firstname AND ; >>New_master.lastname=ALLTRIM(Master.Lastname)) >>>>
>DELETE NM ; >FROM New_Master NM >WHERE NM.AccountNo IN ( ; > SELECT T.AccountNo ; > FROM Master T ; > WHERE NM.PhoneNo = T.PhoneNo ; > AND NM.Exchange = T.Exchange ; > AND NM.FirstName= T.FirstName ; > AND NM.LastName = ALLTRIM(T.LastName) ; > ) >>Now it's easy to highlight the subquery, rightclick Execute Selection, and see that it knows nothing of NM.
>DELETE NM ; >FROM New_Master NM >WHERE NM.AccountNo IN ( ; > SELECT T.AccountNo ; > FROM Master T ; > JOIN New_Master N ; > ON NM.PhoneNo = T.PhoneNo ; > AND NM.Exchange = T.Exchange ; > AND NM.FirstName= T.FirstName ; > AND NM.LastName = ALLTRIM(T.LastName) ; > ) >>Now you can test the subquery.