Subject Some text was missing about speed optimization of DELETE query
Author vishualsoft
But the sub-query works very fast i.e. it takes 1 or two seconds.


Select Distinct(A.var_EmpCode)
from Table_A A Join Table_B B
On
A.var_EmpCode = B.var_EmpCode
And
A.var_PGCode = B.var_PGCode
And
(A.var_Status = 'I'
or
A.var_Resigned_But_Not_Settled = 'Y')

Group By A.var_EmpCode
Having Max(B.dt_AppliedDate) < '03/31/2007'
)